how to create work object for each record in a table using activity
i want to run an agent daily at 8AM and that activity should browse all the records from DB and for each record i need to create work object and store in different table, can please tell me step by step process
In your activity, please follow below steps once you browse the records from DB.
1)Iterate the each record and call the activity work-.createWorkPage by giving the class reference of your case type and primary page(default is pyWorkPage) as parameters to activity. This activity will create the primary page for workobject.
2)After that, if you would like to set the values for few properties in primary page which you created in above activity, you can do it using property set.
3)once done, please call the activity work-.AddWork which will create the workobject based on primary page passed and then call work-.commitWithErrorHandling to commit the work object or rollback incase commit fails.
If you would like to store the work object in another table, then copy the contents of pyWorkPage to page of another class and do obj save.