10-31-2023 12:15 PM - edited 10-31-2023 12:16 PM
I am launching a business rule through a Data Management job for all the base entities of certain rollup, i.e, TopEntity.base. As expected, the code loops through all the base entities and executes the code. I want to log the POV passed in for troubleshooting purposes. When I log the message, it logs it for each iteration of the code. Is there a way to only log the message for the first iteration of the code to avoid logging multiple entries to the log? As a workaround, I have hard-coded a specific entity, but if I can avoid hard-coding that would be ideal. Below is the code snippet:
10-31-2023 03:44 PM
I think you are going to want to use the Globals object. With this, you should create a counter variable and set that variable into globals for each entity to refer to and increment.
11-01-2023 07:53 AM - edited 11-01-2023 07:55 AM
If this is for troubleshooting, create a parameter such as pm_iter. Set it to 0. Then in your br set it to 1 near the end of the code. Put logic around your logging to check if pm_iter = 0. This way it will only log the first time.
11-01-2023 11:05 AM
I believe since this is setup in a DM sequence doing TopEntity.Base, @bk0615, will also need to set the variable in to the globals object so other entities can refence the value.