Sage 100

 View Only
  • 1.  SO Lot/Serial Distribution popup

    Posted 05-21-2019 10:50
    Has anyone been able to use scripting or some method to automate the answer to the popup on an undistributed line item in Sales Order Entry that asks if you wish to delete the line?
    I have a couple clients that want this feature turned on for SO, but only want to use it when they choose to distribute; they don't want the popup every single time. And, the default key stroke is Yes to delete the line. This should to be a SO option to have this Always Yes, Always No, or Prompt, but its not & looking for a shortcut. 
    Is there a way to tap into this event & always select No so they don't have to & they can go back & distribute the lines they want manually?
    TIA
    #script #scripting #serial #Distribution #salesorder​​​​​​ #Sage100 ​

    ------------------------------
    Dana Young
    Lehman Wesley & Associates
    Lansing MI
    ------------------------------


  • 2.  RE: SO Lot/Serial Distribution popup

    Posted 05-21-2019 16:30
    Edited by Alnoor Cassim 05-21-2019 16:48

    It's a good question. I've done this with mods. If you think of S/O Invoice Data Entry, you are prompted to ship complete and if you say Yes, any Lot / Serial items from the order will NOT auto-pop the "Distribution is out of balance" message despite Qty Shipped <> Qty Ordered at that point but the yellow triangle will still show indicating an undistributed line. So to tap into that you need to do a SetMessageType(-1) from the Tier Dist UI object BEFORE user presses the OK or Cancel button.

    You will have to test this. The correct choice is the one that works.

    1. Panel OnExit script for CI_CommonTierDistribution_UI  / SO_SalesOrderTierDistribution_UI
    In this case oUIObj was already passed in and set so it's just: 
    retVal = oUIObj.SetMessageType(-1)

    If it doesn't work it's prolly b/c OnExit processed AFTER the system popped the Dist is OOB msg so try to:

    2. Create your own button that does above then oScript.InvokeButton("BT_OK")

    3. Alternately try a PostRead business script from the Tier Dist biz object.
    If oScript.UIObj Then
       Set oUIObj = oSession.AsObject(oScript.UIObj)

       retVal = oUIObj.SetMessageType(-1)
    End If

    ------------------------------

    Alnoor Cassim

    Free Agent Developer and Consultant
    CallForHelp.biz
    Email: alnoor@callforhelp.biz
    Orange County, CA
    ------------------------------



  • 3.  RE: SO Lot/Serial Distribution popup

    Posted 05-30-2019 11:13
    Hey Alnoor, thanks for the suggestions, but I can't get it to work. 
    Option 1 - does nothing
    Option 3 - does nothing
    Option 2 - error, attached.

    Please let me know a good time that we could connect for a short session to review.
    Thx! ~Dana

    ------------------------------
    Dana Young
    Lehman Wesley & Associates
    Lansing MI
    ------------------------------



  • 4.  RE: SO Lot/Serial Distribution popup

    Posted 05-30-2019 14:06
    In Option 1 finding the exact place to run it from in Customizer Selection can be tricky since you have to find DDistribute under module Common Information > Common Entry. Also since @Kevin Moyes showed you UI scripting on your other thread, note the event here is Panel OnExit instead of Panel PostLoad​ in case that's relevant. Also, you should add a MessageBox in this OnExit script to see if it's working but firing off AFTER the system pops the Distribution is OOB msg. That's why I mentioned Option 2.

    On  Option 2 prolly you need to Set oUIObj = oSession.AsObject(oScript.UIObj) first before the SetMessageType and InvokeButton. Either that or in the button properties you have Execute Script on Client set instead of Execute Script on Server.

    Option 3 was a shot in the dark. Hope that all helps. If you still need me then let's setup for next week.

    ------------------------------
    Alnoor Cassim

    Free Agent Developer and Consultant
    CallForHelp.biz
    Email: alnoor@callforhelp.biz
    Orange County, CA
    ------------------------------



  • 5.  RE: SO Lot/Serial Distribution popup

    Posted 05-31-2019 13:03
    Ok, got it to work. Woo hoo.

    I did the button script:
    retVal = oUIObj.SetMessageType(-1)
    oScript.InvokeButton("BT_OK")

    Put it in place of the Cancel button & hid the original button & it works! 
    I don't know why it wasn't working the first time because this is Option 2 you gave me. Those same 2 lines were in that error, but now it works fine.
    And, I had to switch it to the Cancel button because as long as there is no Serial Number listed, the OK would work, but as soon as it was distributed, the OK button gave a script error. 

    Thank you so much!!!

    Follow up note, is there a way to avoid the Distribution window from auto-opening at all?


    ------------------------------
    Dana Young
    Lehman Wesley & Associates
    Lansing MI
    ------------------------------



  • 6.  RE: SO Lot/Serial Distribution popup

    Posted 05-31-2019 17:35
    Now that you have it working, what could happen is it may suppress the Dist OOB message from other places you don't want it suppressed (e.g. Invc DE, PO ROG Entry, IM Trans Entry, etc). So definitely test for that. If you want to conditionalize the suppression, these can help:

    FolderName = oUIObj.GetFolderName()
    PanelName  = oUIObj.GetPanelName()
    ScreenName = oUIObj.GetScreenName()

    For avoiding the Dist window, I need the business reason so I can properly answer :-) If you just want to auto-distribute where you know the Lot or Serial No already, then I'm 99% sure between HL and SageCity you can find a script example somebody has posted already. Not uncommon.

    ------------------------------
    Alnoor Cassim

    Free Agent Developer and Consultant
    CallForHelp.biz
    Email: alnoor@callforhelp.biz
    Orange County, CA
    ------------------------------



  • 7.  RE: SO Lot/Serial Distribution popup

    Posted 06-04-2019 10:36
    They don't want to auto-distribute at all. They just don't want the nuisance of the popup screen & extra clicks to close it.
    If they want to distribute, they can click the button to distribute. I find it odd that Sage assumes you want to distribute every time or doesn't allow for a setting to have this box auto-display or not. Most of our end users want the ability to distribute during SO Entry, but rarely use it until SO Invoice Entry.

    Thanks!

    ------------------------------
    Dana Young
    Lehman Wesley & Associates
    Lansing MI
    ------------------------------