Posted: 29 Jan 2017 0:03 EST Last activity: 16 Feb 2017 3:19 EST
How to save history record in History-Data-Admin-Operator-ID class when operator instance is saved by activity
I am creating a workflow where end user can update Operator ID profile. When workflow is completed, I am running an activity to save OperatorID page that was input from UI into database. It is working fine except for Operator's history. When we save Operator record from Designer Studio, PRPC automatically adds an record in History-Data-Admin-Operator-ID class (physically pr_history_data table) with history memo of "Saved this record" and I want to do the same in my activity. I am simply calling Data-Admin-Operator-ID.Save but I believe I need to call some other out-of-the-box activity as well. What is the name of activity? I traced activities that get run when Operator ID is saved in Designer Studio but I could not find something special. Please see attached for my code.
***Updated by moderator: Lochan to update Categories***
By default all the corresponding Save activities will have the History-Add method in it to save the history of the saved record, i had cross checked the Data-Admin-Operator-ID.Save activity in v7.2.2 and it contains the History-Add method in it as shown in attachment.
If you are working in different version then you can use the History-Add method in activity or History_Add activity which is available in parent class i.e. Data-
Data-Admin-Operator-ID.Save activity has parameter of "HistoryMemo" but when I pass String it is written to the History Work class (History-MyCo-MyApp-Work), not History-Data-Admin-Operator-ID class. PRPC should have a whole mechanism that adds records automatically in History Operator table when Operator ID is created or saved, and this mechanism automatically includes the entire snapshot of page. What I want is to call this entire mechanism somehow, not just History-Add.
In tracer i had noticed the Primary Page class for the History-Add method is Data-Admin-Operator-ID in Save activity when i tried to update an operator normally, could you look into the document attached and try accordingly.
I traced my activity and found History-Add's Primary Page Class is "Data-Admin-Operator-ID". However it is saving record in History of Work class, and it is NOT saving anything in History-Data-Admin-Operator-ID class. I also tried in a separate step adding History-Add method with the same step page but the result was the same. For step page, I am setting a Single Page property (class of Data-Admin-Operator-ID) but is this wrong?
Thanks for sharing the requested information. Today i had created a similar use case at my end and tried with call pxUpdateRecord activity by passing the step page of type Data-ADMIN-Operator-ID and its working fine.
Note: pxUpdateRecordwill act as a create/update functionality based on the available of the existing record in your activity.
Kindly go through the use case created at my end in the attachment and let me know if it resolved your issue.
Can you please try embedded Single Page for your step page, instead of top page to see if that works as well. In my case, I copied embedded page into top page and that worked. However I believe embedded Single Page should work as well. Please see my workaround solution in the attached. Isn't this a product defect?
I had tried to use the embedded page property in the step name of the activity and its not able to save the history into the pr_history_data table, infact i am facing error when i am using Embedded page property as step page while saving history.
If you are not satified with the local change suggested and needs more investigation to be done you can go ahead and raise an SR for our further investigation.
Since we need to complete this development in a day or two, we are not creating an SR for this. I handled this by my local change workaround (copy to an intermediate top page from embedded page just for this). This is technically a product defect but I hope someone finds workaround from this post.