Peoplecode on the Secondary pages
Peoplecode on the Secondary pages - Pains with Do modal ()
Some notes when working with secondary pages.
It is possible to bring up a secondary page using the DoModal ()
Peoplecode function. To make the data contained in that secondary page to be part of the component buffer, you’ll have to place a secondary page control in one of the standard pages of your component. Elementary. However, there’s something I didn’t discover until recently.
From the standard pages of your component, Peoplecode have full access to component buffer, including the data/rowsets contained in the secondary pages. If the secondary page is active however, Peoplecode access is limited to the fields available in the secondary page. This means that if your secondary page control is inserted in scroll level 1 of the standard page, Peoplecode running when the secondary page is active will not have access to scroll level 0 fields, or the other records and fields on scroll level 1 that is not on the secondary page itself. Even the function GetLevel0 ()
would not provide access to the full component rowset.
If Peoplecode events fired from the secondary page and your Peoplecode need access to other data contained in component, what are the solutions?
- A quick way, if you don’t want to mess with the pages, is to use component variables. Prior to calling
DoModal()
, store all the values that you need in component variables. Note that you can’t use buffer variables, such as fields, records, rows, rowsets. This will still be pointing to inaccessible resources when the secondary page is active. - If your Peoplecode is going to update a field, then the 1st method is not applicable. Your solution is to add the fields that you want to update in your secondary page. If you place it on the same location (scroll path) as the field in the main component, then it will share the same buffer space as the field you want.
- If you need to access (grand)parent row or rowset for update, you can’t use the 2nd method — too bad we can’t specify a negative scroll level. Perhaps the only solution is to use component variables, which you painstakingly set and read before and after
DoModal()
for applying buffer changes.
-Ganesh A.M
3 comments:
-
Ganesh, would it help, If you inserted the secondary page onto the main page? Tried this?
-
Ganesh, Would it help if you inserted the secondary page onto the standard page?
-
Thanks a lump buddy....i mean it