Requery View Issue

The place for peer-to-peer support for developing client-server applications with VPME 9.1.

Requery View Issue

Postby wftdata » Sun Dec 10, 2017 9:57 pm

Hi...Anyone out there?

I am using VPM 9.1 and creating Views for tables with filters. The app is a conversion from an existing system. All the forms and relations work well and are setup in the DD. I have a program that is run from the main form that merges data from current record and child views. They are related by nFileNo. The code is in a program that is called after a document is selected for the merge.

The issue is that no matter what I do I cannot get the View to give me ALL records, bypassing the filters. Everything is setup correctly in DD and the SQL Find Form works and gives me ALL records when no parameters are entered when using the app.

The code is supposed to do a SELECT with the view and just give me child records for the current record. This is the code that I used to test: ( I need to do this to 19 views as I merge data)

(gnKeyNo is File No of Current Rec)

_SCREEN.oApp.oVPMDataHandler.REQUERYView('Mort_lv')
SELECT * FROM Mort_lv WHERE Mort_lv.nFileNo = gnKeyNo INTO CURSOR Merge_C
SELECT Merge_C
BROWSE &&Displays EMPTY CURSOR

All I get is an EMPTY Cursor. When I use the underlying Table, it works fine. I thought the REQUERY Function with no Filter Array will produce ALL Records. Any suggestions as to why this is happenning and what code is needed to give me the View with all records?

Thanks,

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

Re: Requery View Issue

Postby Bob » Mon Dec 11, 2017 5:43 am

Are there any records in 'Mort_lv' before the SELECT?
Bob
 
Posts: 718
Joined: Mon Jun 14, 2010 6:53 am
Location: Near Albany, NY

Re: Requery View Issue

Postby wftdata » Mon Dec 11, 2017 11:58 am

Hi Bob. The Mort_lv should have records but when I browse it, it's empty. I think it is a scoping issue within the framework. If I move code to form and use thisform.vpmdatahandler within a method it works. Only when I call from a prg the issue arises. Would like to know how to make it work in a prg.
Thanks,

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

Re: Requery View Issue

Postby stecenko » Mon Dec 11, 2017 4:22 pm

In the Tech Ref Manual on page 68, there's a method of vpmApp

InstantiateDataHandlerObject

Instantiates the data handling object
(_SCREEN.oApp.oVPMDataHandler) for the
application object’s private data session. The object is
instantiated from the class specified in the property
cDataHandlerClass.


So yes, it's probably a scoping issue. I think you have to instantiate the DataObject in your prg.

Or, I think, but I'm not sure, you can pass thisform as a reference to a parameter of the prg and then use properties and methods of the calling form. Or, you might be able to pass the dataSessionID.
Richard Stecenko
Interactive Computer Services Inc.
Victoria, British Columbia
204.453.2052
stecenko
 
Posts: 822
Joined: Mon Jun 21, 2010 8:06 pm
Location: Saanich, British Columbia

Re: Requery View Issue

Postby wftdata » Mon Dec 11, 2017 10:36 pm

Hi Richard,

I answered my own question! You are right. It was a scoping issue and the code is in the DE OpenTables of a system Report. I should have known this but got lost for a few weeks chasing my tail. As I have conversed with you before, I was converting my app to C/S using views. A big learning curve and I appreciated your input before. Not many users online to help but appreciate any guidance. Once I finish converting to Local Views, I'll start with the process of creating Remote Views and migrating data to SQL Server. Another big hurdle to learn but it will be worth it.

Hope you have a great Holiday season.

Thanks,

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


Return to VPM Enterprise 9.1 - Client Server

Who is online

Users browsing this forum: No registered users and 1 guest

cron