M.App Enterprise Discussions

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Posts: 31
Registered: ‎03-16-2020
Accepted Solution

Save user id by javascript api



I just need to save user id in form by JavaScript API function.


just like that, there is getUserName() return name of the user



Context.setValue('user_name', Context.getUserName());			</SaveShellAction.BeforeScript>

so I just want a function to return id of the user.


Technical Evangelist
Posts: 1,420
Registered: ‎09-11-2015

Re: Save user id by javascript api

I suppose this question was already answered (in support ticket), but you can use Entity Trigger to store the user id before saving the form:

<Entity Id="Crime_ent" Table="Crime" Key="Guid" SyncType="Automatic" >
   <Field Name="userID" Type="Guid" />
      <UpdateFieldTrigger Method="BeforeSave,BeforeUpdate" Field="userID" Value="@{System.UserId}" />


Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial