1 Reply Latest reply on Aug 15, 2013 8:31 PM by MichaelN

    Help with custom script that can enter a users name


      I am trying to use the custom calculation script to automatically fetch and enter the users name in a field. Is this possoble? It seems easy to get the date, but the users name seems hard to get.

        • 1. Re: Help with custom script that can enter a users name
          MichaelN Level 3

          If you mean the user's login name, then you can find this by using




          However, due to security restrictions you need to create a trusted function, as the identity object properties are accessible only during batch, console and application initialisation events.


          The function would look something like this:


               getUserName = app.trustedFunction(




               var c = identity.loginName;


               this.getField("myUserName").value = c;   //places the login name into the myUserName text field




          You place the above script in the JavaScripts folder of the user.


          You then call this function by the following:




          This will place the login name into "myUserName" text field on the form.


          Hope this helps.