Business rule working when insert manual but via web service insert not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2024 01:32 AM
Hi All,
There is a before business rule which is working fine and increment the asset id when we manual insert or update to the table but when record is insert or update using web service it is not working.
Here is the Script:
(function executeRule(current, previous /*null when async*/ ) {
var tempValStr = gs.getProperty('current_tag_number');
var tempVal = parseInt(tempValStr); // Convert to integer
var value = (tempVal * 1) + 1;
var result = ("00000" + value).slice(-6);
current.asset_tag = result;
gs.setProperty('current_tag_number', value.toString());
})(current, previous);
Please help! I want to know the exact issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2024 04:17 AM
You could add a log to confirm the script is not executing with the web service, then you would need to examine the web service process/script to make sure it does not include something like setWorkflow(false) which prevents Business Rules from running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2024 10:14 AM
Thankyou for your response. I will try this approach