Scripting

  • 1.  Hello all - trying to determine if I can get aroun

    Posted 08-17-2015 21:02
    Hello all - trying to determine if I can get around an issue with a script. My client (on Advanced 5.10) uses Advanced Field Settings to require the Ship Via code in Sales Order Entry but can't use RMA Xpress Sales Order because of this setting (gets a message stating order can't be created). So I tried with just a simple pre-write for Sales Order script instead but I get the same results. Any suggestions about another road I can go down...maybe specifying ""source module = SO"" only or something similar?


  • 2.  RE: Hello all - trying to determine if I can get aroun

    Posted 08-17-2015 21:23
    I don't get this message with just the Adv Field Setting for required and a blank Ship Via. I get the Ship Via is required message. What else could be causing your order not to be created??


  • 3.  RE: Hello all - trying to determine if I can get aroun

    Posted 08-17-2015 22:16
    Prudy you're close. First of all I say get rid of the AFS because you can't fire them off conditionally and it's limited by user-company combination. For your Pre-Write script that requires a ShipVia, prior to the SetError() you can do something like this: ` BOI = oSession.ObjectInterface InUpdate = oSession.Updating Security = oBusObj.SecurityAccess StartProgram = Trim(UCase(oSession.StartProgram)) If (BOI > 0 or InUpdate > 0 or Security = 0 or StartProgram <> ""SO_SALESORDER_UI"") Then Exit Sub ` Each of those means something very important (I would leave them all in) but the StartProgram is most relevant to you. When creating RMA Xpress sales order, the StartProgram = RA_RETURN_UI so you could simply do If oSession.StartProgram = ""RA_RETURN_UI"" Then Exit Sub But then there are so many other ways to create sales orders like RMA Gen, Auto Generate Orders, EDI mod, a web service that uses BOI. So better to check for <> SO_SALESORDER_UI Hope that helps. #ScriptingStartProgram


  • 4.  RE: Hello all - trying to determine if I can get aroun

    Posted 08-18-2015 08:53
    Thank you. Alnoor. That got me through the main problem. I will play with it to see if I can get it to work once the xpress order gets created...I'm assuming it has to do with the edit state. Thanks again!