Client Scripting for triggering last order history for catalog item in servicenow portal and service

1dusjhyahnt
Tera Contributor

Client Scripting for triggering last order history for catalog item in servicenow portal and servicenow instance

14 REPLIES 14

yes @Amit Verma please update me fast regarding this ?

@1dusjhyahnt  Just checked some posts around this. It is not possible to have a common Catalog Client  Script across catalog items until the variables of a catalog item belongs to the same Variable Set. Refer https://www.servicenow.com/community/developer-forum/a-single-catalog-client-script-for-multiple-cat...

https://www.servicenow.com/community/developer-forum/catalog-client-script-on-multiple-catalog-items...

 

Do you have a variable set which is common across these 20 Catalog items ? If not, then you need to map Individual On-Load Catalog Client Script only to each catalog item and call Script Include.


Please mark this response as correct and helpful if it assisted you with your question.

Hi @Amit Verma 

 

I need this alert for all user not  for one  user, please tell me what changes i should do ??

@1dusjhyahnt 

 

No need to change anything. It will work for all the users as we are passing the requestor sys_id dynamically in the client script to the script include via 

var requestorSysID = g_user.userID;

 

g_user.userID gives you the sys_id of the user who is trying to access the catalog item.

 


Please mark this response as correct and helpful if it assisted you with your question.

hI @Amit Verma 

 

ONLY THIS CODE WORKING FOR admin , its show only admin last order date 

 

Requirement :- Like My Client want when manager approve the request in sc_req_item table , then alert will triggered for user who raised the request previously, for portal when user submit the request then i will triggered the last order date to user who raised the request thats our requirement?? please help me that's urgent