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

SumanthDosapati
Mega Sage
Mega Sage

Hi Deepa,

1) Where are you running this script? Is this a background script

2) Line num 2 should be encoded query instead of add query

3) What is your requirement. It is not clear.

 

Regards,
Sumanth

Hi,

Any update?

Hi,

 

I created Business rule into Request Item.

The script addinfo message - display the correct value but the same value not displaying into field Queue name.

 

Change this line 

current.variables.queue_name.SetDisplayValue(requestItem.variables.queue_name.getDisplayValue());

to

current.variables.queue_name = requestItem.variables.queue_name;

 

But still I don't understand your business requirement.

Try the above change.

 

Regards,
Sumanth