setValue not working on the OnLoad for the Catalog item

NehaSNOW
Tera Guru

Hi Members,

 

I have a 'description' field on the Catalog Item. I have written the below script to set the value in the 'description' field on OnLoad Catalog Client script which is not working. Please suggest.

 

Release - Xanadu.

NehaSNOW_0-1738500228665.png

 

1 ACCEPTED SOLUTION

Viraj Hudlikar
Giga Sage

Hello @NehaSNOW 

 

Can you change Ui Type - All instead of desktop. I guess that is reason your script not working.

 

If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

View solution in original post

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

@NehaSNOW 

Request you to close your earlier questions by marking appropriate response as correct.

Members have invested their time and efforts in helping and responding to your posts and replies.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar Where is your answer for this question? If your solution works, then I will mark it appropriately. Please have patience as we also have to try other answers replied by the members.

@NehaSNOW 

Question below was answered by me but seems it's not yet closed

Apply Client Script in the Catalog Item 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

rajeev17
Mega Guru

Hi Neha ,

 

can you try with the below scrip :

function onLoad() {
var username = g_user.getUsername();
g_form.setValue('description', 'username ' + username);
}