_screen.oApp.oVpmDataHnadler

The place for peer-to-peer support for VPM Enterprise 9.1, our latest framework.

_screen.oApp.oVpmDataHnadler

Postby stecenko » Thu May 11, 2017 10:41 am

How do I use the dataHnadler in a prg?

I thought I could use...

_screen.oApp.oVpmDatahandler

as described in the Tech Reference Manual printed page 73, pdf page 83)

But when i have

_screen.oApp.oVpmDatahandler.openView

I get an error....

Unknown Member oVpmDataHandler
Richard Stecenko
Interactive Computer Services Inc.
Winnipeg, Manitoba
204.453.2052
stecenko
 
Posts: 745
Joined: Mon Jun 21, 2010 8:06 pm
Location: Winnipeg, Canada

Re: _screen.oApp.oVpmDataHnadler

Postby Bob » Thu May 11, 2017 11:45 am

I think that is an object reference in the data aware form classes ...
Bob
 
Posts: 701
Joined: Mon Jun 14, 2010 6:53 am
Location: Near Albany, NY

Re: _screen.oApp.oVpmDataHnadler

Postby wftdata » Thu Aug 24, 2017 10:39 pm

Richard,

There is code in the system reports that shows how to do it. I used the following code in a program and it worked. Adjust it as needed:

****************************************************
LOCAL slcUserID,slcDataHandlerClass,slcDataHandlerClass_ClassLibrary,sloDataHandler

lcAlias = UPPER(tcAlias)

slcUserID = ''
IF _SCREEN.oApp.cAppPre = 'APP'
slcDataHandlerClass = 'prodatahandler'
slcDataHandlerClass_ClassLibrary = 'prodatahandler'
ELSE
slcDataHandlerClass = _SCREEN.oApp.cDataHandlerClass
slcDataHandlerClass_ClassLibrary = _SCREEN.oApp.cDataHandlerClass_ClassLibrary
IF TYPE('_SCREEN.oApp.oSec') = 'O'
slcUserID = _SCREEN.oApp.oSec.UserData_cUserID
ENDIF
ENDIF

IF NOT LOWER(ALLTRIM(slcDataHandlerClass_ClassLibrary)) $ LOWER(SET('CLASSLIB'))
SET CLASSLIB TO (slcDataHandlerClass_ClassLibrary) ADDITIVE
ENDIF

sloDataHandler = CREATEOBJECT(slcDataHandlerClass,_SCREEN.oApp,_SCREEN.oApp.oAPDRecord.cEncrChar,;
_SCREEN.oApp.oAPDRecord.cOrigin,slcUserID,_SCREEN.oApp.oAPDRecord.cDDD_DDDS,_SCREEN.oApp.oAPDRecord.cDDD_V,;
_SCREEN.oApp.oAPDRecord.cDDD_VDBC,_SCREEN.oApp.oAPDRecord.cDDTV_DDDS,_SCREEN.oApp.oAPDRecord.cDDTV_V,;
_SCREEN.oApp.oAPDRecord.cDDTV_VDBC,_SCREEN.oApp.oAPDRecord.cDDDS_V,_SCREEN.oApp.oAPDRecord.cDDDS_VDBC,.F.)

sloDataHandler.OpenView('IDS_LV','Invoice_LV')

sloDataHandler.LocateFor('IDS_LV','Ids_lv.Table = lcAlias')
IF FOUND()
lnID = ids_lv.nextid
REPLACE ids_lv.nextid WITH ids_lv.nextid + 1
ENDIF

sloDataHandler = .F.

IF lcAlias = "INVNO" OR lcAlias = "CUST_LV"
RELEASE lcAlias
RETURN lnID
ELSE
RELEASE lcAlias
RETURN PADL(lnID,9,"0")
ENDIF
*************************************
Hope this helps.

Regards,

Bill
wftdata
 
Posts: 53
Joined: Thu Jun 23, 2011 8:42 pm
Location: East Moriches, NY 11940


Return to VPM Enterprise 9.1

Who is online

Users browsing this forum: No registered users and 1 guest

cron