What are the best practices for fetching and updating records in external database tables from PRPC
We have a scenario where the PRPC should point to the external Database and create necessary data classes in PRPC. The external DB contains the foreign key relations as mentioned below and the corresponding Data Classes in PRPC.
Consider a one – to – one relation from CFSDPolicy to CFSClaim table.
With this Data Model structure, what are the best practices for fetching and updating the records.
What we have done:
- To Fetch a CFSPolicy Record with CFSClaim data..
-
Created a Report Definition in CFSPolicy data class and used joins in Data access tab of RD to connect to CFSClaim data class.
-
We have a scenario where the PRPC should point to the external Database and create necessary data classes in PRPC. The external DB contains the foreign key relations as mentioned below and the corresponding Data Classes in PRPC.
Consider a one – to – one relation from CFSDPolicy to CFSClaim table.
With this Data Model structure, what are the best practices for fetching and updating the records.
What we have done:
- To Fetch a CFSPolicy Record with CFSClaim data..
-
Created a Report Definition in CFSPolicy data class and used joins in Data access tab of RD to connect to CFSClaim data class.
- Created an activity which loads the Report Definition and merges the CFSClaim from pxPages of pxResults into “CFSPolicy.CFSClaim”.
-
- To update a CFSPolicy record and the corresponding CFSClaim record..
-
Separated CFSClaim from CFSPolicy Object.
- In the activity step, called “Save” on CFSPolicy
- Removed pxSubscript from CFSClaim object
- In the activity step, called “Save” on CFSClaim
-
If this was in pr_other table, we can treat the CFSPolicy and CFSClaim as one unit as CFSPolicy contains CFSClaim. Fetching or saving CFSPolicy will fetch or save CFSClaim record also. But when it is external tables , then we have to treat CFSPolicy and CFClaim as different.
For more info, please refer the attached doc..
***Updated by moderator: Lochan to add Categories***