Scripting

  • 1.  UDS - InvokeChange Method Causes Screen Corruption

    Posted 02-04-2017 16:08
    UDS - InvokeChange Method Causes Screen Corruption A simple Column Post-Validate UDS assigned to the QuantityOrdered field of ""SO_SalesOrderDetail_bus"" demonstrates this issue. A successful InvokeChange method on the UnitPrice field causes screen corruption when the down arrow is used to move directly from a modified Ordered field to the next line. The corruption is that the ItemCode, Ordered and Unit Price fields from the initial line are copied to the following line. There are no screen customizations. The InvokeChange method was used because SetValue causes the panel's Total Amount field to go wonkie. This occurs on Standard versions 5.30.0.0 (2016), 5.20.4.0 and 5.20.2.0 (2015). I've included a simple script that recreates the issue. If anyone has any ideas to avoid this (other than not using the down arrow), I am all ears. nPrice = 1.2345 set myUIObj = oSession.AsObject(oScript.UIObj) retVal = myUIObj.InvokeChange(""UnitPrice"",nPrice,""GD_Lines"") Set myUIObj = Nothing The issue can be recreated in the ABC company by creating a new order, entering an item code such as 6655 and an order quantity of 1 then press the down arrow.


  • 2.  RE: UDS - InvokeChange Method Causes Screen Corruption

    Posted 02-04-2017 20:20
    Try SetValueNoValidate(""UnitPrice"", nPrice) instead of SetValue and instead of InvokeChange.


  • 3.  RE: UDS - InvokeChange Method Causes Screen Corruption

    Posted 02-04-2017 23:14
    That stopped the duplication, but doesn't increment the Total Amount on the panel. :-( It feels like I'm playing wack-a-mole. Thanks for the response. Shouldn't InvokeChange have worked?


  • 4.  RE: UDS - InvokeChange Method Causes Screen Corruption

    Posted 02-05-2017 19:54
    Hmm try going back to InvokeChange but add a Detail Post-Write script to refresh the grid. Have a feeling it will not refresh ergo your Post-Write could instead InvokeButton to a button (script) that you've added to DMain (not PLines). That button will do both oScript.LinesAdded=n (number of your choice) and then oScript.LoadGrid(""GD_Lines"") To recap, revert back to InvokeChange, create a button on DMain to refresh grid, add a Detail Post-Write to InvokeButton to the button just added. Sounds nutty but if it works and you only want to refresh grid when necessary, back on your column post-validate at the end you can set a flag with oScript.SetStorageVar(""PostValRan"", 1) then in your Post-Write oScript.GetStorageVar(""PostValRan"", n) and If n=1 Then InovkeButton(). Just thinkin out loud. Hope it works.


  • 5.  RE: UDS - InvokeChange Method Causes Screen Corruption

    Posted 02-06-2017 16:10
    All good suggestions, but the duplication continues on standard 2016 no enhancements. Bare bones re-creation script is as follows: SO Detail Post-Write: retVal = oScript.InvokeButton(""BT_LINK_1"") Button Script: retVal = oUIObj.InvokeChange(""UnitPrice"", 1.23, ""GD_Lines"") Changing the UnitPrice is successful except that it is displayed on the following line. Going to the Totals tab and back clears the unexpected data in the next line, but the values changed are lost.


  • 6.  RE: UDS - InvokeChange Method Causes Screen Corruption

    Posted 03-23-2017 10:30
    Sage's (Elliot) suggestion was to use SetValue , but that causes the order total at the bottom right of the sales order entry screen to become corrupted. This is why I resorted to using InvokeChange - because it is suppose to support the UI - I thought.


  • 7.  RE: UDS - InvokeChange Method Causes Screen Corruption

    Posted 03-23-2017 11:23
    A couple of thoughts: 1) I just inherited somebody's PO Entry script on PostVal of a Line UDF that is doing InvokeChange() on the grid line. It is duplicating the PO line. For myself I cannot dupe the issue but for the user he can do every time. I'm having him ""reset all grids"" for now to rule that out but I'll let you know if I discover something new. They upgraded from v2013 where it was working to v2017. 2) With mods, I can maintain ML_TOTAL (the screen variable on the bottom right) myself as the same issue can occur where it gets all wonkie at times. So I imagine you could maintain with a script if so inclined: retVal = myUIObj.SetValue(""ML_TOTAL"", n)


  • 8.  RE: UDS - InvokeChange Method Causes Screen Corruption

    Posted 03-23-2017 11:31
    Interesting - for me, the duplication only occurs when using the down arrow to go to the next line. Maybe you aren't seeing it because you are using the Enter key to move through fields/lines.


  • 9.  RE: UDS - InvokeChange Method Causes Screen Corruption

    Posted 03-31-2017 13:11
    Hey Dan - The client just emailed back. He was using the down arrow to move to next line when his line duplicated. The good news is ""reset all grids"" did work for him as he says it doesn't happen anymore. Also, he had to do the reset from each machine it was happening from. Hope this helps.


  • 10.  RE: UDS - InvokeChange Method Causes Screen Corruption

    Posted 03-31-2017 19:21
    As soon as I return from Yosemite, I'll give that a try. Thanks. I had not tried that.