How to write script to get current logged in user's name into description of catalog

Obito
Tera Expert

How to write script to get current logged in user's name into description of catalog

Obito_0-1717074501266.png

 

1 ACCEPTED SOLUTION

SAI VENKATESH
Tera Sage
Tera Sage

Hi @Obito 

 

You need to write client Script(onload) on the sc_cat_item table and below is the script:

function onLoad() {
    // Specify the sys_id of the catalog item to check
    var targetSysId = 'c112f7fcc30e8210d30c564ed4013101';
    var currentSysId = g_form.getUniqueValue();
    if (currentSysId === targetSysId) {
        var userName = g_user.getFullName();
		g_form.setValue('description',userName);
    }
}

 

cn109.PNG

 

 

 

Thanks and Regards

Sai Venkatesh

 

View solution in original post

3 REPLIES 3

Saloni Suthar
Mega Sage
Mega Sage

Hi @Obito ,

What is your use case? 


If my response helped you, please click on "Accept as solution" and mark it as helpful.
- Saloni

SAI VENKATESH
Tera Sage
Tera Sage

Hi @Obito 

 

You need to write client Script(onload) on the sc_cat_item table and below is the script:

function onLoad() {
    // Specify the sys_id of the catalog item to check
    var targetSysId = 'c112f7fcc30e8210d30c564ed4013101';
    var currentSysId = g_form.getUniqueValue();
    if (currentSysId === targetSysId) {
        var userName = g_user.getFullName();
		g_form.setValue('description',userName);
    }
}

 

cn109.PNG

 

 

 

Thanks and Regards

Sai Venkatesh