Business Rule - Updating a Current Field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 12:03 PM
I'm trying to update a current field and no matter what I try it doesn't work and the field is left blank.
This BR fires on the sc_task table and the u_orch_name and u_orch_output_parms are both there from the task table. If I do a gs.log on current.u_orch_name then I see the value just fine. However, when I try to update the u_orch_output_parms field to 'TESTER' it doesn't work. The field is a text field up to 1k chars. I tried using a glidescript to hit the task table and update the field there and still no go. Any idea why this isn't working?
- Labels:
-
Best Practices
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 01:30 PM
Odd, I thought I posted this as a question? How do you do a question?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 01:44 PM
Two thoughts for you,
1. You could strip out the code which sets the u_orch_output_parms field and make it a "before" business rule. You wouldn't have to include the update, since that is implied to happen after the "before" rules run.
2. If you keep it as an "after" business rule, you may want to add a line to disable the business rules from running on your update. This avoids additional updates which you may not want to happen at this point. Placing the following line before your update should do the trick:
current.setWorkflow(false);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 12:20 PM
Rebecca , Its weird, everything luks good.
do few troubleshooting steps like
try printing property output
gs.addInfoMessage(gs.getProperty(property name));
and then add gs.adinfoMessage('I am inside if statement') inside if statement to check if its going inside the if {}
This might help you find the issue