Scripting

  • 1.  OK, fellow scripters. I have a script that's runn

    Posted 05-11-2015 07:38
    OK, fellow scripters. I have a script that's running on Column - Post-Validate of the QuantityShipped field in SO_InvoiceTierDistribution. Question: Can I refer to fields from the current SO_InvoiceDetail record? If so, how?


  • 2.  RE: OK, fellow scripters. I have a script that's runn

    Posted 05-11-2015 10:04
    Brute force? Use the InvoiceNo and LineKey fields to ""Find"" the SO_InvoiceDetail record?


  • 3.  RE: OK, fellow scripters. I have a script that's runn

    Posted 05-11-2015 10:12
    Yeah, that'll work. I was just thinking it should be available in some available object somewhere.


  • 4.  RE: OK, fellow scripters. I have a script that's runn

    Posted 05-11-2015 10:19
    @BrettLyder you could also use a Memory variable: Give the variable a name ""memQtyShipped"" and set the value as you read the current S/O line or if the qty shipped changes retVal = oSession.AsObject(oSession.ScriptObject).SetStorageVar(""memQtyShipped"",tmpQtyShipped) Load the quantity shipped from the ""memQtyShipped"" variable during a SO_InvoiceTierDistribution event: retVal = oSession.AsObject(oSession.ScriptObject).GetStorageVar(""memQtyShipped"",tmpQtyShipped)


  • 5.  RE: OK, fellow scripters. I have a script that's runn

    Posted 05-11-2015 10:21
    Maybe one of the PVX types here could give a clue...I didn't see anything of interest in a dump of the SO_InvoiceTierDistriubtution context.


  • 6.  RE: OK, fellow scripters. I have a script that's runn

    Posted 05-11-2015 10:24
    Hmm, thanks guys. When i'm in the script, i can't use the business object to even read the Tier Distribution fields. They are coming up blank. I think i'm going to try @DougJenkins suggestion and pass in what i need as memory variables.


  • 7.  RE: OK, fellow scripters. I have a script that's runn

    Posted 05-11-2015 20:46
    What Doug said exactly! That's what I had to do in a similar line Tier Distribution script. Also in Tier Distribution object you may need to get the value off the control instead of the value in the field, that is: oUIObj.GetValue() instead of oBusObj.GetValue() However if you're not running from a button you must first do: oUIObj = oScript.UIObj Set oUIObj = oSession.AsObject(oUIObj) If have a Tier Dist UDF then the normal oBusObj.GetValue() should work.


  • 8.  RE: OK, fellow scripters. I have a script that's runn

    Posted 05-12-2015 05:39
    Thanks @AlnoorCassim this one is even better. I need to get all the way back to the SO_SalesOrderDetail. I have to use the invoice/linekey from the tier distribution. Then get the order linekey from the invoice line(And the SalesOrder# from the invoice header, then i can read the SO_Order Detail line, good times...good times...