Populate Short Description Field On Incident Form

snow7
Kilo Contributor

Hi Guys,

I want to populate some text filled in Short Description Field on Incident Form for a particular user.Let me know how to achieve this through client script

14 REPLIES 14

I have one doubt will it be OnLoad() or OnChange() ? Please clarify this


Hi Gourav,



If you want in onchange of User go ahead with Onchange otherwise if you want it to run when the user opens the form use On Load.



It depends on your requirement.


Hi,


I have tried it in OnLoad() but its not working.And in OnChange() also its not working,


function onChange(control, oldValue, newValue, isLoading, isTemplate) {


    if (isLoading || newValue === '') {


          return;


    }


var userID = g_user.userID.;


if(userID == "f9826bf03710200044e0bfc8bcbe5d2e")


{


g_form.setValue("short_description","test");


}


Hi Gourav,


The code provided was for the login in person.



Do you want it to be based on caller ?


if (isLoading || newValue === '') {


          return;


    }


if(newValue== "f9826bf03710200044e0bfc8bcbe5d2e")


{


g_form.setValue("short_description","test");


}



On load for caller.


var userID = g_form.getValue("caller");


if(userID == "f9826bf03710200044e0bfc8bcbe5d2e"){


g_form.setValue("short_description","test");



}



Hope this helps you


Hi Sneha,


Thanks for your help.I really appreciate.I have one more doubt on this if I want to set this condition for multiple users or users with specific roles then how I will achieve this requirement?


Also where can i write Glide record script for table level?