How to get previous value when form is submitted from UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2020 03:34 AM
Hi All,
I am trying to get the previous value from the form when the form is submitted from UI action using
current.submit();
Now the BR is calling but getting current previous values as same.
Can someone help on this please.
Thanks.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2020 03:57 AM
Hi Chaitanya,
use:
1) current.update();
2) after insert and update business rule.
try this it may work.
Kindly Mark Helpful and Correct if it works and fulfill your requirement.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2020 04:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2020 04:44 AM
you can check with below code in business rule.
var count =0;
for(var field in current)
{
if (current[field] != previous[field] )
{
count++;
}
}
gs.addInfoMessage("count= " + count);
it will give you how many fields have been updated.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2020 05:22 AM
Hi,
current.update in BR is not a good practice it takes you in infinite loop.
If you are using current.update then also use setWorkflow as false then you will get values.
Thanks,
Dhananjay.