Sage 100 - Determine if update is programmatic via BOI or Sage Application user

SUGGESTED

Wondering if there are some flags/properties in the BOI object that can be used to determine if an update (CI_Item in this case) are

coming from a Sage Application user or from a BOI program within a Pre-Write script.

psuedo=allow spaces when coming from BOI app update, but not when using the native Sage app.

Reasoning:

i have a Pre-Write script that prohibits users from entering spaces in new item codes. For a user in the Sage application, I do NOT want
them to enter items with spaces.

However, there are years of items which were entered with spaces. These items generally have some history, so using the

BOI application we have written which manages item codes across several Sage companies, the program will respect the existing spaces.

Otherwise we get into a large item merge project which we are stalling until we are ready.

Happy times people,

Bret

  • 0

    Why not just check the EditState for the record?

    retval = 0

    if oBusObj.EditState = 1 then 'existing record

    retVal = oSession.AsObject(oSession.UI).MessageBox("Existing Record")

    else if oBusObj.EditState = 2 then 'new record

    retVal = oSession.AsObject(oSession.UI).MessageBox("New Record")

    else ' edit state 0 the only other option

    retVal = oSession.AsObject(oSession.UI).MessageBox("No Record in memory")

    end if

    end if

  • 0 in reply to Kevin M

    Kevin,

    I currently use the edit state...will pursue it to resolve my issue. Thanks my good man.

    I tried posting my code to show, but the forum can't handle my sample code for some reason.

    AT ANY RATE

    I can take it from here.

    Best regards,

    Bret

  • 0
    SUGGESTED

    from scripting doc in cUIObj can't you use 

         ' This is a Business Event script. Must test if UI is present/available

         MASUI = CBool(oScript.UIObj)

         If (MASUI) Then

                 ' Need to get my own handle to access oUIObj functionality such as InvokeChange(), InvokeLookup(), Etc.

                 Set myUIObj = oSession.AsObject(oScript.UIObj)

                 screenName = myUIObj.GetScreenName()

                 panelName = myUIObj.GetPanelName()

                 folderName = myUIObj.GetFolderName()

                 Set myUIObj = Nothing

         End If