Pls let me know the correction in the correction
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2022 07:27 AM
Hi, let me know the correction in the script as the field didnt display the value:
// Add your code here
var requestItem = new GlideRecord('sc_req_item');
requestItem.addQuery('cat_item.nameSTARTSWITHPrinter ');
requestItem.addEncodedQuery('number='+current.number);
requestItem.query();
while(requestItem.next())
{
gs.addInfoMessage(requestItem.variables.queue_name.getDisplayValue()); //this value displaying info message
current.variables.queue_name.SetDisplayValue(requestItem.variables.queue_name.getDisplayValue()); //but it didnt display into the field Queue Name.
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2022 03:23 AM
Did you try the above solution?
Feel free to reach out if you have further questions or else you can mark an answer as correct and helpful to close the thread so that it benefits future visitors also.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2022 11:06 PM
Hi,
just put addEncodedQuery in the place of addQuery in the second line & try it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2022 11:30 PM
Changing 2nd line doesn't make any difference. Tried and tested.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2022 11:59 PM
When this code gets executes? In a business rule? Since added 'current.number' part of query it restricts to a single record i.e the current record, so I don't get the need of getting the current record's queue_name (display value of reference field group) and assign to the same variable?! Looks like your source/target record seems to be different.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 03:02 AM
's' should not be capital in SetDisplayValue.
current.variables.queue_name.SetDisplayValue(requestItem.variables.queue_name.getDisplayValue()); //but it didnt display into the field Queue Name.
current.variables.queue_name.setDisplayValue(requestItem.variables.queue_name.getDisplayValue()); //but it didnt display into the field Queue Name.