Question
EAI Systems
SA
Last activity: 27 Jun 2018 4:34 EDT
Loop through all records
hi,
My Requirement is to update the database i.e pegarules for that we have used activity using obj-open method by using pyID in property name and value we have hardcoded that is working Perfectly fine for single record but now we want to access for all records present in database,we tried to loop through but it throws error that we cant loop through obj-open?
can anyone help me out to loop through all records using pyID
Thanks in adance.
Regards,
Shweta V Singh.
***Moderator Edit: Vidyaranjan | Updated Categories***
Hi @SHWETAS7,
Thanks for your post on PSC.
Obj-Open is used for browsing an instance of the class as expected it worked fine for you in the first case. Though, now you want to browse all the records of a class.
Use the Obj-Browse method to search instances of one class and copy the entire instances, or specified properties, to the clipboard as an array of embedded pages.
Only properties exposed as columns can be used as selection criteria. However, values of properties that are not exposed as columns, including embedded properties, can be returned.
You can perform your update activity as per business requirement and save the instances by using Obj-Save.
Refer links for understanding:-
- Obj methods
- Obj and RDB methods explanation.
Hope it answers your query, kindly notify by marking this post as answered/helpful for larger Pega audience.
Regards,
Asif