I want to Auto populate either the SO Entry Header Email or a UDF with the email address of the user entering the order.

SOLVED

I figured out how to get the name, using a session object, but I don't think there is an osession for email.  Below is my attempt at using osession, and the second is my direct attempt. I am new to this, so any help would be appreciated.

UserCreatedKey.retVal = 0

If UserCreatedKey.EditState = 1 Then

retVal = UserCreatedKey.SetValue("UDF_Orig_User$", oSession.UserName) '

End If

This is my second atempt

retVal = 0

 

 

 

oUser = 0

 

 

 

Set oUser = oSession.AsObject(oSession.GetObject("SY_User_svc"))

 

 

 

userKey = ""

 

 

 

retVal = oBusObj.GetValue("UserUpdatedKey$", emailaddress)

 

 

 

If oUser.Find(userKey)=1 Then

 

 

 

emailaddress = ""

 

 

 

retVal = oUser.GetValue("UserUpdatedKey$", emailaddress)

 

 

 

retVal = oBusObj.SetValue("UDF_SHIP_CONF_EMAIL$", emailaddress)