Sage 100

 View Only
Expand all | Collapse all

New customer on 2014 Advanced. I'm still trying t

  • 1.  New customer on 2014 Advanced. I'm still trying t

    Posted 12-03-2014 11:39
    New customer on 2014 Advanced. I'm still trying to talk them out of it but they have this S/O numbering system that they want to employ. Back in the old days, i had a client that wanted something similar and I just created a script that generated the next number, populated the Order number box and off we they went. Once the Business Framework came into play, a script button on the SO Entry screen would not become active until after an order was started. So...I created a dummy sales order using the # sign. They'd hit the # bring up that dummy order and then run my next # script that would calculate the next SO #, close the dummy(#) order and put the calculated # in the order box. I could do something similar to this again this time. Whew! If you're still with me, I'm sorry for you. Question: Anybody have a better idea?


  • 2.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 12-03-2014 16:18
    What's different about the number that the customer doesn't want a sequential SO number? Could you do this through scripting?


  • 3.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 12-03-2014 16:29
    If you want to make Customizer link buttons active while no order is loaded on the screen you can DFDM the M4L file under SO\Custom and change the button group value. When I get to a computer I can tell you the value. But can you elaborate on the Next Order No scheme itself they need


  • 4.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 12-03-2014 16:31
    They want an letter prefix then 2 digit year then sequential # after that. Separate sequential #s for each prefix year combo. I am going to script the logic but the problem how and when to fire script and set the SO number.


  • 5.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 12-03-2014 16:35
    Thanks Alnoor, that would be great! I can code the rest. See explanation on my last post if you'd still like to know what they want the number to be.


  • 6.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 12-03-2014 16:39
    DSD. SO-1394 Additional Order and Invoice Number Series. http://www.dsdinc.com/enhancement/additional-order-and-invoice-number-series-2/


  • 7.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 12-03-2014 20:51
    That sounds like an interesting mod to allow Customizer link buttons to be active before a number is entered. I've been doing custom numbering systems in scripting, but had resorted to requiring a trigger letter (like N for next) to get a script to activate.


  • 8.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 12-03-2014 21:07
      |   view attached
    Bret to make your Customizer button behave like the Next Order No button see attached. When no order is loaded on the screen both buttons are enabled, when an order is loaded then both buttons are disabled (to demonstrate how they behave the same). Make sure you BACKUP the M4L you'll modify. Once you open the M4L in DFDM look around in DMAIN and find the record representing your BT_LINK_X control.


  • 9.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 12-04-2014 03:56
    Yes it does. I have a couple scripts that may be candidates for testing @DanBurleson


  • 10.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 12-04-2014 05:27
    Thanks again Alnoor, that'll make a nice clean solution!


  • 11.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 12-04-2014 11:40
    @AlnoorCassim or anyone...the custom button behaves like i was hoping it would. BUT, how do i get the calculated next SO # back to the order form? Sendkeys doesn't seem to be working now. Is it because the script button is set to keyfield now?


  • 12.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 12-04-2014 12:49
    The better approach I think is to have your button write the fancy order no to SO_Options then auto-click the Next Number button. I just tried that but it fails on Write with ""You do not have security rights to modify the record"". I'll revisit this later when I have some more time If CBool(IsObject(oSOOptions)) = False Then Set oSOOptions = oSession.AsObject(oSession.GetObject(""SO_Options_Bus"")) End If myFancySO = ""ABCDEFG"" 'Using this as an example retVal = oSOOptions.SetKey(""S/O"") retVal = oSOOptions.SetValue(""NextSalesOrderNo$"", myFancySO) If retVal <> 1 Then sMsg = ""Error setting value on NextSalesOrderNo"" retMsg = oSession.AsObject(oSession.UI).MessageBox(sMsg) End If retWrite = oSOOptions.Write() If retWrite <> 1 Then sMsg = ""Error on write back to SO_Options"" & vbCrLf & oSOOptions.LastErrorMsg retMsg = oSession.AsObject(oSession.UI).MessageBox(sMsg) End If retVal = oScript.InvokeButton(""BT_NEXTNUM"") retVal = oUIObj.HandleScriptUI()


  • 13.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 12-04-2014 13:24
    @BrettLyder I haven't tested but the code I posted right above this should work if you transform it to a BOI style external script. So make your Customizer button a BOI button and change it to Execute on Client.


  • 14.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 12-04-2014 13:33
    Awesome, thanks Alnoor. I'll give it a go.


  • 15.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 12-05-2014 07:37
    You know although you should be able to update SO_Options this way the external BOI may not have an oScript collection to auto click BT_NEXTNUM


  • 16.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 01-16-2015 00:09
    Stuffing oSOOptions with the next order number is a great idea, but what if I want to implement a next sequential vendor number? There's no button or option field for that.


  • 17.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 03-02-2015 23:08
    Bret this is what I was telling you about at MOTM that I shared in class. I clearly over-thought it when you originally posted. It's basically 1 magic InvokeChange() line '----------------- SCRIPT START ------------------------------------------- 'Assuming they will now click the custom office button instead of the regular Next Order No button. 'This BT_LINK_X button has KEYFIELD for the button group as described earlier myFancySO = ""ABCDEFG"" 'Using as an example but substitute your code here to derive the fancy SO 'These next lines not necessary for this script but very handy 'if it were an event script and you needed oUIObj isButtonScript = IsObject(oUIObj) ' If an event script set oUIObj - button scripts already have it If isButtonScript = False Then oUIObj = oScript.UIObj Set oUIObj = oSession.AsObject(oUIObj) End If 'Knowing that the standard BT_NEXTNUM button uses UI object to write the next SO to the control 'Do InvokeChange() from oUIObj to write the fancy SO to the CONTROL instead of SetValue() from oBusObj retVal = oUIObj.InvokeChange(""SALESORDERNO"", myFancySO) retVal = oUIObj.HandleScriptUI() @Sage100AdvancedScripting


  • 18.  RE: New customer on 2014 Advanced. I'm still trying t

    Posted 03-09-2015 10:42
    Thanks Alnoor! I really appreciate the follow-up. Sorry, i meant to say thanks last week when you posted it.