Need to map record producer variables on a form to the record created form fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
14m ago
required help @Ankur Bawiskar @Vasantharajan N
Once the record producer form is submitted it is creating WVIR0001054 record in the backend as the record producer is created under application: Workplace Visitor Management.
Now I need to map the variables of the record producer form to the record WVIR0001054 that is creating in the back end.
I tried with below scripts in the Record Producer Script option but it's not working as expected
current.first_name = producer.visitor_name;
tried with business rule as well with the below script in the record WVIR0001054
After Business Rule
Insert Checked
(function executeRule(current, previous /*null when async*/) {
var mapping = {
'visitot_first_name' : 'first_name';
};
var qa = new GlideRecord('question_answer');
qa.addQuery('table_sys_id', current.sys_id);
qa.query();
while (qa.next()) {
var variableName = qa.question.name.toString();
if (mapping[variableName]) {
current[mapping[variableName]] = qa.value.toString();
}
}
current.update();
})(current, previous);Multirow Variable Set: Table Name: sc_cat_item_producer
Record Form: Table Name: sn_wsd_visitor_visitor_registration
Here the variables need to map with the fields on the form
And as per the requirement approvals also need to be created like 1st Request Item need to be created and need to go for approval once approved then the record WVIR0001054 need to be created.