Scripting

  • 1.  I have a script in PO detail that displays a warni

    Posted 08-25-2015 08:44
    I have a script in PO detail that displays a warning message if the primary vendor of the item does not match the vendor for the purchase order. It also checks a UDF on the Vendor as well as on the item. Users are receiving an error #88 Invalid/unknown property name. It's definitely related to role maintenance as the script works for the admin account but I can't determine what needs to be changed. The user has permission to AP Vendor and CI Item. Anyone have any ideas, short of giving access to everything and then taking rights away to isolate what the problem is?


  • 2.  RE: I have a script in PO detail that displays a warni

    Posted 08-25-2015 08:49
    Can you post the script?


  • 3.  RE: I have a script in PO detail that displays a warni

    Posted 08-25-2015 08:59
    sUDF_WalmartApproved = """" sUDF_Retailers_Item_No = """" sVendor = """" sDivNo = """" sItemNo = """" 'Only work with user is in company TST If oSession.CompanyCode <> ""TST"" Then Exit Sub End If retVal = oBusObj.GetValue(""ItemCode$"",sItemNo) if Not(IsObject(oItem)) then set oItem = oSession.AsObject(oSession.GetObject(""CI_ItemCode_bus"")) end if retVal = oItem.SetIndex(""KPRIMARY"") retVal = oItem.Find(sItemNo) retVal = oItem.GetValue(""UDF_RETAILERS_ITEM_NO$"",sUDF_Retailers_Item_No) if sUDF_Retailers_Item_No = ""WAL05"" then retVal = oHeaderObj.GetValue(""VendorNo$"", sVendor) retVal = oHeaderObj.GetValue(""APDivisionNo$"", sDivNo) if Not(IsObject(oVendor)) then set oVendor = oSession.AsObject(oSession.GetObject(""AP_Vendor_bus"")) end if retVal = oVendor.SetIndex(""KPRIMARY"") retVal = oVendor.Find(sDivNo & sVendor) retval = oVendor.GetValue(""UDF_WALMARTAPPROVED$"", sUDF_WalmartApproved) if sUDF_WalmartApproved = ""Y"" then ' Fall through - no error Else sMsg = ""This is not a Walmart Approved Vendor."" retVal = oScript.SetError(sMsg) End If End if


  • 4.  RE: I have a script in PO detail that displays a warni

    Posted 08-25-2015 09:13
    Your script looks fine to me. What event is triggering it? ItemNo PreWrite? I've been encountering error 88s for some button scripts in 2014 Advanced lately. If the user clicks the button again, it then works as expected. Can't find any consistency with it.


  • 5.  RE: I have a script in PO detail that displays a warni

    Posted 08-25-2015 09:26
    I was just thinking since you're not changing anything in CI_Item or AP_Vendor, maybe try the _SVC object instead. Less permissions required, so maybe you won't get tangled up in anything else.


  • 6.  RE: I have a script in PO detail that displays a warni

    Posted 08-25-2015 09:32
    That was my thought too @SteveIwanowski - I'd also add in some debug prints to see exactly where things are going wrong. If you can duplicate the error that is


  • 7.  RE: I have a script in PO detail that displays a warni

    Posted 08-25-2015 09:50
    Thanks, I'll try these suggestions. Its a pre-validate on the Item on PO Detail


  • 8.  RE: I have a script in PO detail that displays a warni

    Posted 08-25-2015 10:00
    Using _svc object did not make a difference. Onto Alnoors suggestion


  • 9.  RE: I have a script in PO detail that displays a warni

    Posted 08-25-2015 11:28
    @AlnoorCassim & @SteveIwanowski just an FYI - I worked with Kelsey on this and the issue was permissions to the CI_Item. We switched the _bus to _svc and set the users permissions to ""View"" on CI_Item and all works fine now.


  • 10.  RE: I have a script in PO detail that displays a warni

    Posted 08-25-2015 11:32
    Thanks Nic!


  • 11.  RE: I have a script in PO detail that displays a warni

    Posted 08-25-2015 11:35
    Thanks @NicoleRonchetti!