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

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.

Thanks @Viraj Hudlikar  it worked. May I know the reason? I am accessing the Catalog from my Desktop not from Mobile then I believe selecting the UI Type as 'Desktop' should work. Please advice.

@NehaSNOW -

When UI Type = Desktop, means that script will work for only native UI of catalog item.

When UI Type = Mobile, means that script will work for only mobile interface of catalog item.

When UI Type = Both, you know the answer now.

Thanks & Regards,
Viraj Hudlikar.

@Viraj Hudlikar I know the purpose of different UI types. But my question is when  I am accessing the Catalog from my Desktop not from Mobile then what is the need of selecting the "Both". I believe selecting the UI Type as 'Desktop' should work. Please advice.

@NehaSNOW - See when ui type is desktop means its not like actual desktop machine it is like accessing from native ui ie. serivce catalog page.

When ui type is mobile/portal means it will run only when item is access from portal or through mobile.
If still not clear i suggest you write a simple onload client script with alert statement in it and set ui type as first desktop then portal then all.
You will understand there working.
Now when you select type desktop and if you open your catalog item from below module screenshot then only it will work.

VirajHudlikar_0-1738567139685.png