Contributed by Sharon Buntz
The PFC 5.0.xx Save Process does not support DataStores.
- In order to have the save process properly update your DataStores, you will need to extend pfc_w_master's update-related events, such as:
For assistance on how to extend and what to add to each event, please see the PFC MAG article on pfc_w_master at this site.
- Another viable alternative is to simply use an invisible u_dw DataWindow rather than a DataStore.
- Note that in PFC 6.0, both regular DataStores and n_ds DataStores will easily be able to participate in the Save Process. All you will need to do is add your DataStore to the container control's Update Objects array. Then, the "Logical Unit of Work" (LUW) service will pick it up in one of two ways: First way, the LUW can handle a native PowerBuilder DataStore (as 5.0 handled a PB DW). And secondly, since the new pfc_n_ds will be equipped with the "Self-Updating Object API" functions, when the LUW tells the n_ds DataStore to update itself, it will know how to do so.
In addition, please note that the PFC 5.0.xx pfc_n_ds did not contain some of the services similar to u_dw's, such as
- Basic services (previously contained only a small subset of the u_dw counterpart's)
- Multi-Table Update service
- Report service
- Print Preview service
So if you need to use these for a DataStore, you will have to add in those service(s) to your pfc_n_ds.
Again, note that in PFC 6.0, the DataStore object will contain these missing services.
The datastore pfc_print event will open the standard print dialog to allow the user to configure the printer, after which the datastore should be printed. However the platform service of_printdlg used to display the standard print dialog requires a reference to the parent window:
instancename.of_PrintDlg ( printinfo, window )
|instancename||Instance name of n_cst_platform|
|printinfo||S_printdlgattrib instance containing print information (passed by reference)|
|window||Window variable containing the window opening the Print dialog box|
The pfc_printdlg datastore event will pass the parent window reference. But unless that reference has been previously defined the call to of_PrintDlg will return an error.
For this reason before attempting to to use the PFC datastore print features you must set a reference to the parent window by calling the of_SetParentWindow function:
ids_data = CREATE n_ds ids_data.DataObject = "d_empall" ids_data.of_SetTransObject(SQLCA) ids_data.of_SetParentWindow(this) ... ids_data.Event pfc_print()
Contributed by PFCGuide staff, except
where noted otherwise.
PFCGuide is sponsored by Dynamic Technology Group
The information provided is for advice only and not to be considered a contract or a liability against Dynamic Technology Group.
Last revised: February 15, 2004 03:58 AM.