Scripting

  • 1.  Hi all,I have a very simple script that prevents

    Posted 07-07-2017 19:53
    Hi all, I have a very simple script that prevents users from getting into a sales order if the Picking Sheet has been printed, but it also prevents the sales order from fully completing and getting removed from Sales Order Entry when it is shipped. Any ideas how I can allow this to work only when the UI is used and not any other time? SOPickEdit = 0 SOPickEdit = oSession.AsObject(oSession.Security).IsMember(""SOPICKEDIT"") if SOPickEdit > 0 then exit sub end if sSalesOrder = """" : sPickPrinted = """" retVal = oBusObj.GetValue(""SalesOrderNo$"", sSalesOrder) retVal = oBusObj.GetValue(""PickingSheetPrinted$"", sPickPrinted) if sPickPrinted = ""Y"" then sMsg = ""Picking Sheet has been printed. Use Sales Order Inquiry to view SO "" & sSalesOrder & ""."" retVal = oBusObj.SetToReadOnly(sMsg) end if


  • 2.  RE: Hi all,I have a very simple script that prevents

    Posted 07-07-2017 20:05
    If oScript.UIObj is greater than 0 then the UI is available. You can additionally check the oSession.StartProgram property. It should be SO_SALESORDER_UI if running under sales order entry.


  • 3.  RE: Hi all,I have a very simple script that prevents

    Posted 07-10-2017 10:10
    Thank you, David. I can't believe I didn't think of the StartProgram property. I'm sure I've used it before. Thanks!!