Error "IM_ItemWarehouse does not have correct permissions" when using IM_ItemWarehouse_bus or _svc (v2021 with Update 2)

SOLVED

I'm receiving a cryptic error stating "IM_ItemWarehouse" does not have correct permissions when I do a SetKeyValue and Find via IM_ItemWarehouse_bus (and _svc).  Code is below.  I've also tried using a SetBrowseFilter and that works until it reaches the last record and throws this same error.  I have checked the IM_ItemWarehouse table for invalid records, but I don't see anything amiss.

Has anyone seen this kind of error?  Any genius ideas out there?  I'm about to try an ODBC query at this point.. But performance is so poor..

Again, the error also occurs when using SetBrowseFilter when it reaches the last warehouse record for the item.  And this has happened with any item number I've tested.  This is version 2021, so I wondered if that may be the problem, but this script works in another company without issue.  I'm still trying to figure out what's possibly different about that company.

Parents
  • 0

    Strangely, I'm not able to reply to Kevin's post.  Getting error.  Ironic.  I'll paste my reply here.

    Thanks very much, Kevin.  As you suggested, I did try the _svc and find with sItemCode &   but am still getting the same error.  I also tried the SetKey (rather than find) with _bus and got the same error. Disappointed

    Any more suggestions?  And thanks so much for responding.  I appreciate the insights.

  • 0 in reply to n0tgunshy2

    Wrap your new object creation in this structure, which verifies permissions.

    oBankCode = oSession.GetObject("GL_Bank_bus")

    if oBankCode <> 0 then

            Set oBankCode = oSession.AsObject(oBankCode)

    else        

            retVal = oSession.AsObject(oSession.UI).MessageBox("", "Access to GL_Bank_bus is required for the ... script to work.")

            exit sub

    end if

  • 0 in reply to Kevin M

    Thanks, Kevin.  I've done that, also.  It is reading the file records, but it bombs on the last warehouse for each item.  Could this be a bug, you think?

Reply Children