Getting User Code

SOLVED

I am trying to change the user code on orders importing through ROI's Insynch based on the customer no.  To get the user code do you use "oSession" I wouldn't think so because the actual user is not actually in the session right?  And I shouldn't use "oBusObj" either because it is in another table, not the header correct?  I do not see any examples of going into the SY_User table from the header to pull the value.

Parents
  • 0

    Here is a code I use to get the User first and last name. Maybe this will give you some idea

    sFirst = "" : sLast = "" : sKey= "" : sCKey = ""

    retVal = oBusObj.GetValue("UserCreatedKey", sCKey)

    Set oUser = oBusObj.AsObject(oBusObj.GetChildHandle("UserCreatedKey"))

    retVal = oUser.getvalue("UserKey$",sKey)
    retVal = oUser.getvalue("FirstName$",sFirst)
    retVal = oUser.getvalue("LastName$",sLast)

    If sKey = sCKey then
    retVal = oBusObj.SetValue("UDF_FIRST$", sFirst)
    retVal = oBusObj.SetValue("UDF_LAST$", sLast)

  • 0 in reply to BigLouie

    Thanks, actually just found that post with this code, trying out an option now.

Reply Children
No Data