Parameters within Script include not generating any results
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2024 04:10 AM
I've got a script include with the following function:
However, I've also tried copying the function into a background script:
Can somebody explain where I'm going wrong because I want the parameters in my function to align correctly within my gliderecord
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2024 04:22 AM
This log statement only appears in your previousData function.
So I suspect even though you pasted the business rule code, its not THAT business rule that's running.
Something else is calling the previousData function instead of the currentData one
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2024 04:47 AM
Hi @Uncle Rob
I've just updated a record and the business rule has triggered. It seems that I was looking at the wrong area. It seems to now get the right results according to the logs:
However though, I need to know why it's not showing the results in my while loop:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2024 04:38 AM
If that loop isn't outputting anything then the likeliest cause is spcRecords.next() has not returned anything. You could try putting this before the loop:
gs.log('Row count of spcRecords' + spcRecords.getRowCount();
I suspect that will be zero or undefined. And if it is, now we have to figure out why its not finding anything.