How to get the requested for user name from a catalog form

juliochacon23
Tera Expert

Hi, I am working on a request catalog form with orchestration.  I need to find a way to pull the user name field from the requested for field instead of the logged-in user.  I am currently using a catalog client script with the code below to pull the user name but this gives me the logged in user name instead of the requested for.  Any advice on how to get the user name for requested for?

 

juliochacon23_0-1679073954341.png

 

juliochacon23_1-1679074013144.png

 

 

function onLoad() {

                                var userID = g_user.userName;

 

g_form.setValue('user_name',userID);

  

  

}

 

2 ACCEPTED SOLUTIONS

I got the mistake that you are doing @juliochacon23 In client script code of 7th line change sysparam_sys to sysparm_sys and also change script include 5th line sysparam_sys to sysparm_sys .Then it will definitely work please check onces 

If my solution helps you please mark my answer as accepted and helpful.

Thanks and Regards

Uday Kumar Valapudasu 

 

View solution in original post

Amazing support.  Thank!!!!

View solution in original post

14 REPLIES 14

Thanks, I tried it not sure if I did it correctly.  I get an error msg.  See screenshot

 

juliochacon23_0-1679331969110.png

 

juliochacon23_1-1679331977148.png

 

 

 

 

juliochacon23_2-1679331988579.png

 

Hi @juliochacon23 Copying the code directly won't give results for your reference i sended it's ok @juliochacon23 send me your variable names of (user name) and (requested for) i will send the code for your requirement in just 2 min.

 

Please mark my response as helpful and accepted solution incase of any doubt please ask me @juliochacon23 

Thanks and regards

Uday Kumar Valapudasu

Sorry for the late response Uday.  Here are the variable names

user_name

requested_for

 

Let me know if you need more info

 

Thanks!!

 

Julio

Hi @juliochacon23  Change your Script Include name to "user_name" then it work's fine.

 

If my solution helps you please mark my Solution Accepted and Helpful.

Thanks and regards

Uday Kumar Valapudasu

I must be doing something wrong @Uday_Kumar .  Nothing comes up for user name.  The field is blank.  See screenshots

 

Script Include

juliochacon23_0-1680284619002.png

 

Catalog Client Script

juliochacon23_1-1680284643909.png

 

juliochacon23_2-1680284651248.png

 

 

Thanks for helping me with this.

 

Julio