How to get currently logged in employee details in

2019-07-23 05:31发布

I need to get the currently logged in employee details like internal ID etc., When the employee views the particualar customer record. So that i can save the staff who actually visited lastly the customer in our own site.

3条回答
再贱就再见
2楼-- · 2019-07-23 05:42

"nlapiGetContext()" is the API you should be calling in a script. It returns a "nlobjContext" object containing information (metadata) about the current user or script context.

  • Deploy a "User Event on BeforeLoad Event"/"Client Script on PageInit Event" for the Customer Record Type.

  • Call the NetSuite API nlapiGetContext() to get all the pertinent details of the logged in user viewing the Customer Record. Your employee need not necessarily submit the Customer Record and deploying the script on beforeLoad/PageInit will still get you the data of the user accessing the record.

  • To get the internal id of the user specifically, you could add the below line in your script nlapiGetContext().getUser()

查看更多
别忘想泡老子
3楼-- · 2019-07-23 05:44

Try using the current attributes:

<%=getCurrentAttribute('customer','entityID','Guest')%>

or

<%=getCurrentAttribute('customer','internalid')%>">
查看更多
男人必须洒脱
4楼-- · 2019-07-23 06:00

Do a workflow and on "view" state y try saving the field by either the workflow actions or a nlapiSubmitField call.

查看更多
登录 后发表回答