Hello Ming,
I am already using the concept that you mentioned but it is still doing the same. Please find the snippet of it and advise me.
<gel:parameter default="admin" var="xog_user"/>
<gel:parameter default="1" var="debug"/>
<!-- Define Data Source -->
<gel:setDataSource dbId="Niku" var="dbSource"/>
<!--get the xog session id and persist it for later use-->
<core:catch var="xogLoginException">
<core:new className="com.niku.union.security.DefaultSecurityIdentifier" var="secId"/>
<core:invokeStatic className="com.niku.union.security.UserSessionControllerFactory" method="getInstance" var="userSessionCtrl"/>
<core:set value="${userSessionCtrl.init(xog_user, secId)}" var="secId"/>
<core:set value="${secId.getSessionId()}" var="xog_session_id"/>
</core:catch>
Original Message:
Sent: 05-12-2021 08:24 AM
From: Ming Cheung
Subject: Created by field needs to be updated
Hi Arunachalam,
The system is displaying the "XOG, XOG" user as this is the account used when generating the session ID for your XOG calls. It is possible to create a Session ID for another user without knowing credentials and using that to run the XOG calls. This means that the user who created the original record would have the instance rights (as the instance creator) to the new instance and they must have create rights on your sub-object.
Here is a GEL snippet to get a session ID for another user ID:
<core:new className="com.niku.union.security.DefaultSecurityIdentifier" var="secId"/><core:invokeStatic className="com.niku.union.security.UserSessionControllerFactory" method="getInstance" var="userSessionCtrl"/><core:set value="${userSessionCtrl.init(Username, secId)}" var="secId"/><core:set value="${secId.getSessionId()}" var="sessionID"/>
Where Username is the username of the resource you want to appear in the Created By and sessionID is the resulting session ID you can use for your XOG call. If you do not want the resource to have access to the new instances you are creating, you must either remove the instance rights for the resource or do as Nirbhay suggested and create a custom field.
Original Message:
Sent: 05-11-2021 10:41 AM
From: Arunachalam Angusamy
Subject: Created by field needs to be updated
Hello Everyone,
I have created the two sub object and copying the instance from one sub object to another sub object. Data is xogged successfully but it is coming as a XOG User. How can I copy the created by and place it ?
Sub Object :
Copied data: