- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2023 04:38 PM
Hi,
I am trying to display a Problem Record that has been linked to a change on the Change_Request form.
I have created a new reference field on the Change_request form and have created a Dynamic Reference Qualifier.
The newly created Column name in the Change_request form is u_prb
The Script in the Dynamic Filter is new DynamicPrbUtility().prRecord();
The Script Inlcude is :
var DynamicPrbUtility = Class.create();
DynamicPrbUtility.prototype = {
initialize: function() {
},
prRecord: function()
{
var gr = new GlideRecord('problem');
gr.addQuery('rfc', current.sys_id);
if(gr.next())
{
return number;
}
},
type: 'DynamicPrbUtility'
};
However, the u_prb field doesn't get populated even though I have done the linkage to the Change_request from the Problem form. What am I missing?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2023 05:40 PM
So looks like you have a dynamic filter on the reference field. You are not actually setting the field value.
To set the field value, you may need a before business rule on the problem record instead with below script. This will update the field when you link the change to problem.
var gr = new GlideRecord('change_request');
gr.addQuery('sys_id', current.rfc);
if(gr.next())
{
gr.u_prb = current.sys_id;
gr.update();
}
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2023 04:44 PM
Fix the script. You need to return the sysid i guess
var DynamicPrbUtility = Class.create();
DynamicPrbUtility.prototype = {
initialize: function() {
},
prRecord: function()
{
var gr = new GlideRecord('problem');
gr.addQuery('rfc', current.sys_id);
if(gr.next())
{
return gr.sys_id;
}
},
type: 'DynamicPrbUtility'
};
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2023 04:49 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2023 05:40 PM
So looks like you have a dynamic filter on the reference field. You are not actually setting the field value.
To set the field value, you may need a before business rule on the problem record instead with below script. This will update the field when you link the change to problem.
var gr = new GlideRecord('change_request');
gr.addQuery('sys_id', current.rfc);
if(gr.next())
{
gr.u_prb = current.sys_id;
gr.update();
}
Please mark this response as correct or helpful if it assisted you with your question.