Business rule working when insert manual but via web service insert not working

deepak_dc11
Tera Contributor

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.

2 REPLIES 2

Brad Bowman
Kilo Patron
Kilo Patron

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.

Thankyou for your response. I will try this approach