- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 10:44 PM
Hi All/
We are trying to access record producer varibles value using Business Rule. But we are not able to get the values.
Please guide me. Async/Update BR. We submit the Record Producer after that record is creted respective table. We wrote BR of that table.
(function executeRule(current, previous /*null when async*/) {
gs.info('ITP HR service ' + current.hr_service);
var transfer_person = current.variables.employee_name;
gs.log("Abira transfer for " +transfer_person);
var position = current.variables.new_position;
gs.log("Abira Position " +position);
var effecdate = current.variables.effective_date;
gs.log("Abira date " +effecdate);
var country = current.variables.transfered_position_country;
gs.log("Abira country " +country);
var loc = current.variables.transfered_position_location;
gs.log("Abira location " +loc);
})(current, previous);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 10:47 PM
Hi absnow
what is the purpose of the BR? looks like you are just trying to log few statements.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 11:10 PM
Your code works, can you give us more info on which table you are trying to use this? is it extended from task table?
you can also query question_answer table for submitted values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 10:47 PM
Hi,
Try with producer object instead of current object to access the variables.
(function executeRule(current, previous /*null when async*/) {
gs.info('ITP HR service ' + current.hr_service);
var transfer_person = producer.variables.employee_name;
gs.log("Abira transfer for " +transfer_person);
var position = producer.variables.new_position;
gs.log("Abira Position " +position);
var effecdate = producer.variables.effective_date;
gs.log("Abira date " +effecdate);
var country = producer.variables.transfered_position_country;
gs.log("Abira country " +country);
var loc = producer.variables.transfered_position_location;
gs.log("Abira location " +loc);
})(current, previous);
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 10:58 PM
Hi Sagar,
I am trying producer object instead of current object, still it is not working. Please guide me how can i access it.