Script Error 88 Message

Have a script that runs fine in Sage 100 2013 Standard:

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)

end if

 

I tried the same script in Sage 100 2014 Advanced which has other scripts that run fine and the following error 88 came up.

 


 

The same UDFs were created. Any thoughts anyone.

  • 0

    Hey BigLouie

    AsObject() is a function of the oSession object.

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

    Hope this helps

    E

  • 0 in reply to jepritch

    I just had a quick look and that child handle is only available with Sales Order and not Sales Order Invoice or A/R Invoice. So they won’t be able to access it like that, however, they can just use the service object instead.

    Signed E The Boy Wonder

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

    retVal = oBusObj.GetValue("UserCreatedKey", sCKey)
    Set oUser = oSession.AsObject(oSession.GetObject(“SY_User_svc”))

    retVal = oUser.Find(cCKey)
    If retVal>0 Then
    retVal = oUser.getvalue("FirstName$",sFirst)

    If sKey = sCKey then
    retVal = oBusObj.SetValue("UDF_FIRST$", sFirst)
    end if
    End If