Scripting

Expand all | Collapse all

Sage 100 Premium 2014. Customer would like to dis

  • 1.  Sage 100 Premium 2014. Customer would like to dis

    Posted 10-16-2015 07:16
    Sage 100 Premium 2014. Customer would like to disable the repricing of items on a sales order when they change the quantity. Prices fluctuate all the time in their industry, so most orders are priced manually. Any ideas on how to lock in a price once it is changed manually or disable the repricing routine?


  • 2.  RE: Sage 100 Premium 2014. Customer would like to dis

    Posted 10-16-2015 07:22
    Is ""Item Pricing by Total Quantity"" and ""Price Level by Customer"" turned on in SO Options, Line Entry tab?


  • 3.  RE: Sage 100 Premium 2014. Customer would like to dis

    Posted 10-16-2015 07:30
    Price Level by customer is unchecked, and item pricing by total quantity, enable based on is blank. Is that ""off"" for that feature? They definitely don't use it...


  • 4.  RE: Sage 100 Premium 2014. Customer would like to dis

    Posted 10-16-2015 07:35
    We've run into this request before. We've used scripting to retrieve a saved ""last"" price. Saved last price in a UDF when an SO line record is saved. Use a second script to set unit price to last price(If it exists) when quantity is changed.


  • 5.  RE: Sage 100 Premium 2014. Customer would like to dis

    Posted 10-16-2015 09:07
    I've played around with oScript.DeactivateProcedure for these type of issues. You may try something like oScript.DeactivateProcedure(""*PriceRecalculation*""). Make sure you reactivate it after your script runs.


  • 6.  RE: Sage 100 Premium 2014. Customer would like to dis

    Posted 10-16-2015 12:49
    Just as a heads up, I wrote a script for this for one of my customers with Credit Card processing. For some reason it interfered with the lines updating when a return was done AND there was a deposit on the order. I know we found a workaround for it (and I don't recall what it was, but I can find out if need be). Just wanted to give you a heads up in the event they also do returns, with deposits test that thouroughly. I did not script it the way @MichaelNottoli suggested, (that way seems safer :) )


  • 7.  RE: Sage 100 Premium 2014. Customer would like to dis

    Posted 10-16-2015 13:27
    @MichaelNottoli - ""reactivate after script runs"" - do you mean by another script or as the last line of the script?


  • 8.  RE: Sage 100 Premium 2014. Customer would like to dis

    Posted 10-16-2015 13:39
    Oh, @PhilMcIntosh I saw the Michael, and read my own name. It's Friday. :)


  • 9.  RE: Sage 100 Premium 2014. Customer would like to dis

    Posted 10-16-2015 13:39
    As a separate script. If you can deactivate the price recalculation it will prevent the price form changing all together then maybe reactivate it after you hit the totals tab?


  • 10.  RE: Sage 100 Premium 2014. Customer would like to dis

    Posted 10-16-2015 14:12
    I agree with @MichelleNichols - it's Friday! I'd reactivate with another script, probably from the So_Details Post-Write. That way if they add a line, the recalculation procedure is active. BTW, there should be *s around the procedure name.


  • 11.  RE: Sage 100 Premium 2014. Customer would like to dis

    Posted 10-21-2015 13:53
    What permissions does this script require? It runs on sales order lines. It works with admin, but other users get an error: Invalid/unknown property name, type mismatch 'oSession.AsObject' SY_MAINT.PVC line 3031 I was thinking edit on the sales order (which it obviously has or you couldn't get into the order) and at least view on CI_Item, but users with full access to item maintenance still get the error. dblUnitPrice = 0 dblStoredUnitPrice = 0 dblStdPrice = 0 sItemType = """" sItemCode = """" retVal = oBusObj.GetValue(""ItemType$"", sItemType) If sItemType <> ""1"" then Exit Sub End if retVal = oBusObj.GetValue(""ItemCode$"", sItemCode) set oItem = oSession.AsObject(oSession.GetObject(""CI_ItemCode_svc"")) retVal = oItem.SetIndex(""kPRIMARY"") retval = oItem.Find(sItemCode) If retval = 1 then retval = oItem.GetValue(""StandardUnitPrice"", dblStdPrice) End if retVal = oBusObj.GetValue(""UnitPrice"",dblUnitPrice) retVal = oBusObj.GetValue(""UDF_STOREDUNITPRICE"",dblStoredUnitPrice) If (dblStoredUnitPrice <> 0) and (dblUnitPrice = dblStdPrice) then retVal = oBusObj.SetValue(""UnitPrice"",dblStoredUnitPrice) End if


  • 12.  RE: Sage 100 Premium 2014. Customer would like to dis

    Posted 10-22-2015 07:15
    Don't know about permissions with 100 premium scripts. However I generally use GetChildHandle. Try replacing Set oItem = oSession.AsObject ... with set oItem = oBusObj.AsObject(oBusObj.GetChildHandle(""ItemCode"")). From there you can call oItem.GetValue.


  • 13.  RE: Sage 100 Premium 2014. Customer would like to dis

    Posted 10-22-2015 09:03
    Thanks @MichaelNottoli - that change seems to have done it (pending full customer testing).


  • 14.  RE: Sage 100 Premium 2014. Customer would like to dis

    Posted 11-11-2015 23:34
    @PhilMcIntosh Did you get this working? what were the settings for engaging the script? Thx


  • 15.  RE: Sage 100 Premium 2014. Customer would like to dis

    Posted 11-12-2015 05:30
    @JohnnyPabian - Yes it does work. I used Michael's suggestion - the GetChildHandle seems to do away with the user needing admin level permissions.


  • 16.  RE: Sage 100 Premium 2014. Customer would like to dis

    Posted 11-12-2015 11:35
    +1 on the GetChildHandle routine suggested by @MichaelNottoli I just had the same issue with permissions and a script, and that routine solves it.