Pls let me know the correction in the correction

Deepa12
Tera Contributor

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.
                        
        }
    

 

9 REPLIES 9

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

Shaik Ibrahim k
Tera Contributor

Hi,

just put addEncodedQuery in the place of addQuery in the second line & try it.

 

UDAY KIRAN REDD
Tera Contributor

Changing 2nd line doesn't make any difference. Tried and tested. 

Ramamoorthy N
Tera Contributor

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.

Vishal Dev
Giga Contributor

'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.