- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2024 06:44 AM
I have a requirement like their is two fields one is choice and another is reference. based on choice field selection the reference field values should change.
example: choice field have A,B,C . if A is selects the reference field should show only few options.
if B is selects the reference field should show only few other options.
i used advanced reference qualifier : new Reference_field_validate().getUsers(current.request_type);
script include like :
Any one can help me regarding this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2024 11:56 AM - edited 04-01-2024 12:00 PM
Hello @surendra Gelivi ,
There is a syntax error (current.variables.request_type you should pass a parameter) in your reference qualifier please correct it like below:
Syntax of advanced reference qualifier:- javascript: new Reference_field_validate().getUsers(current.variables.request_type);
I have created a similar case in my PDI it's working fine. Can you try applying the same. My case the filter condition is applying with title.
Note: Go and create a new script include and make sure check the client callable option.
You can try update your function code like below once.
getUsers: function(request_type) {
var Equery;
var users = [];
gs.info("ReqType:"+request_type); // To check the value is coming or not
if (request_type == 'A') {
Equery = 'u_levelINSr Director,Managing Director,Partner,Principal,Income Partner'; // Check the backend value for level.
}else{
Equery = '';
}
var gr = new GlideRecord('sys_user');
gr.addEncodedQuery(Equery);
gr.query();
while (gr.next()) {
users.push(gr.sys_id.toString());
}
gs.info("User List:"+users);
return 'sys_idIN' + users;
},
Below are the ref screenshots:
Please Mark My Answer as Helpful and Accept as Solution, if you find this article helpful or resolves your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 03:53 AM