- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2019 08:41 AM
I have tried both before and after business rules. Even if I have "insert" checked, they only ever work on update. I have two reference fields on the same form. I want to populate u_tac_business_app with the value of u_business_application (dot walked from the other reference field: u_tac_record). This is the current after BR I have. Please help.
(function executeRule(current, previous /*null when async*/) {
current.u_tac_business_app = current.u_tac_record.u_business_application;
current.update();
})(current, previous);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2019 09:52 AM
Hello
Agreed with What dirk Said, Never ever use current.update() in before business rule.
Check field name correctly:
(function executeRule(current, previous /*null when async*/) {
gs.log("Check Value :"+current.u_tac_record.u_business_application); /
current.u_tac_business_app = current.u_tac_record.u_business_application;
gs.log("Updated value"+current.u_tac_business_app);
})(current, previous);
Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade
Abhishek Gardade

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2019 08:44 AM
Hi
Just try to use a BEFORE UPDATE/INSERT Business Rule.
Can you please log the value of
gs.log(current.u_tac_record.u_business_application);
to see, which value do you have in that field?
BTW: NEVER use "current.update()" in your Business rules. The Update is done by the BR automatically.,
BR
Dirk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2019 09:08 AM
It logged the sys_id of the value. I just removed the current.update() . . . I thought it was a no-no for before rules, not after. Thank you for the tip. Any thoughts why the code will not work on insert?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2019 09:28 AM
Hi
Just a silly question: Are your sure, you do NOT have a TYPO in the name, you assign the value to?
Just to cross-check...
Let me know...
BR
Dirk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2019 09:29 AM
Oh no sorry... you wrote it works on update, so forget about it...
BR
Dirk