Unable to get previous value using BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 11:45 PM
Hello,
I am trying to perform some actions based on new value and previous value of BU code field present on user table.
I created after(update on some field value change) BR on user table and writing below code. However I am getting blank value in logs. Please suggest.
if (current.u_sf_business_unit_code.changes()) {
var prevBU = previous.u_sf_business_unit_code;
var newBU = current.u_sf_business_unit_code;
gs.log('previous BU', prevBU);
gs.log('newBU ', newBU);
try {
gs.log('BU changes ');
sn_fd.FlowAPI.getRunner().subflow('global.sml_internal_mover__business_unit').inBackground().withInputs(inputs).run();
} catch (ex) {
var message1 = ex.getMessage();
gs.error(message);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 12:12 AM
Hi @Karishma Dubey ,
Generally, "After" business rule with "Insert / Update" method to get new and old value of CI
Also,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 12:17 AM
What do your logs return when you make it a before BR?
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 01:53 AM
it is still returning me blank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 12:35 AM
Hi,
Previous object (As the database updation is already done) will not be available for After update BR. Please try doing validations with Before Update BR.