Unable to auto populate User details from OnLoad Catalog Client Script

Yerasu Mallikar
Kilo Contributor

Hi All,

Can anyone help me to auto populate User details on Catalog Form using OnLoad Catalog Client Script.

As written Script include also.

@Ankur Bawiskar 

Catalog Form:

find_real_file.png

find_real_file.png

 

Script include:

find_real_file.png

find_real_file.png

 

Catalog Client Script:

 

find_real_file.png

find_real_file.png

find_real_file.png

Variable Values:

find_real_file.png

1 ACCEPTED SOLUTION

shloke04
Kilo Patron

Hi,

I would suggest there is a easier and no code option available OOB which you can use to auto populate this.

Please find the steps below:

Navigate to your Catalog Item and there is a Related List named "Catalog Data Lookup Definition" as shown below:

find_real_file.png

2) Click on New button as shown above:

find_real_file.png

3) Click on new button in Related List "Catalog Matcher Variable Definitions" as shown below:

find_real_file.png

Now Configure this as shown below:

find_real_file.png

Now click on New on the other Related List where you can set the values you want as shown below:

Catalog Setter Variable Definitions:

find_real_file.png

Now just set the variable values which you want:

Here I have set Email. Similarly you can set other variable from User Table

find_real_file.png

Result:

find_real_file.png

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

View solution in original post

19 REPLIES 19

Yerasu Mallikar
Kilo Contributor

@asifnoor @Jaspal Singh @Saikumar @Murthy @Martin Ivanov 

help me to auto populate User details on Catalog Form using OnLoad Catalog Client Script.

As written Script include also.

Catalog Form: marked fields should get auto populate when the User tries to raise the ticket 

image

image

 

Script include:

image

image

 

Catalog Client Script:

 

image

image

image

Variable Values:

image

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Why don't you try something like below

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }
    var ref = g_form.getReference('<user reference field>', getUserInfo);
    }
function getUserInfo(ref) {
        
        g_form.setValue('<field to set>', ref.<user field>);
        g_form.setValue('<field to set>', ref.<user field>);
        g_form.setValue('<field to set>', ref.<user field>);
        g_form.setValue('<field to set>', ref.<user field>);
        g_form.setValue('<field to set>', ref.<user field>);
  
    }
}
-Anurag

it's should display by using OnLoad Client Script so that after changing any filed then the OnChange Client Script will work 

Not sure I follow.

One adds the value to reference field, associated fields get auto populated. 

Now form is saved.

Whenever there is a change these values change as well.

So why do you need to run this onload?

-Anurag

-Anurag