- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2014 06:23 AM
We have created a field for 'u_disable_opening_notification' on the REQ form and have also created this same field as a variable on RITMs.
This is a yes/no answer and needs to be transferred from the RITM variable to the parent request.
We have created a BR that tries to do this but it is not working. I am guessing that we need to create a glide record that matches the parent REQ to the RITM and then sets the field.
We have so far tried...
current.u_disable_opening_notification = current.variables.u_disable_opening_notification;
Any ideas?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2014 09:12 AM
I think you would want to run an after insert business rule on the request item table that copies this value up to the request. If you were to run this on the request, the item may not exist yet.
(function() {
//get the gliderecord for the parent request
var req = new GlideRecord('sc_request');
if (req.get(current.request)) {
req.u_disable_opening_notification = current.variables.u_disable_opening_notification;
req.update();
}
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2014 06:55 AM
you are using current for the req and current for ritm. If BR is set in req table you have to look for the related ritm though gliderecord and then to look forto do something like that:
current.u_disable_opening_notification = grRITM.variables.u_disable_opening_notification;
If BR is in ritm table you have to look for the related request though gliderecord function and to do:
grREQ.u_disable_opening_notification = current.variables.u_disable_opening_notification;
Both of them are ok. Everything will depend of your requirements.
Also you can take a look to the following post: Catalog Item variable not being assigned to Requests
Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2014 09:12 AM
I think you would want to run an after insert business rule on the request item table that copies this value up to the request. If you were to run this on the request, the item may not exist yet.
(function() {
//get the gliderecord for the parent request
var req = new GlideRecord('sc_request');
if (req.get(current.request)) {
req.u_disable_opening_notification = current.variables.u_disable_opening_notification;
req.update();
}
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2014 10:20 AM
Hi Brad, I've tried this but get the below error.
JavaScript parse error at line (5) column (36) problem = missing ; before statement
Also, just to check - I want to use this field to determine whether to send a notification or not, will adding this as a 'after BR' will this be too late and the notification have already sent?
Thanks,
Nat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2014 10:53 AM
I have got round the javascript error (extra space on end of code copied) , but it's still not updating the field on the parent request?
Current code...
Is there any issue with the fields being different types between ESS and the REQ table?
I've set the values of each to be the same, so wouldn't have thought it would cause an issue?
Request Table
Variable