Skip to main content

Notifications

Microsoft Dynamics SL (Archived)

Custom Order Steps using VB Tools

Posted on by 30

We customize a Order Step with exe before the Release for Update in Shippers.  The exe have all the code in the Form_Load() . The problem the exe is not moving to the next order step(i.e. Release for Update.). Is there any way to navigate the step automatically and get the shipper closed automatically.

Thanks in Advance,

 

*This post is locked for comments

  • Apps Mexico Profile Picture
    Apps Mexico 1,090 on at
    RE: Custom Order Steps using VB Tools

    You have to check wich step is the next one and execute the ADG_SOEvent_Create with that step, to the processs manager change take that row.

    This is the part of the code that do this. You can use the sqlprofiler to check what are the parameters that use acording to your configuration.

                                  If serr7 = 0 Then

                                      serr8 = SqlFetch1(CSR_xTZSOStep, "select functionid, functionclass, seq from sostep where cpnyid = " & SParm(bpes.CpnyID.Trim) & " and sotypeid = " & SParm(bSOShipHeader.SOTypeID.Trim) & " and functionid = " & SParm(txTZSOStep.FunctionID.Trim) & " and functionclass = " & SParm(txTZSOStep.FunctionClass.Trim), bxTZSOStep)

                                      serr9 = SqlFetch1(CSR_xTZSOStep, "select TOP 1 functionid, functionclass, seq from sostep where cpnyid = " & SParm(bpes.CpnyID.Trim) & " and sotypeid = " & SParm(bSOShipHeader.SOTypeID.Trim) & " and seq > " & SParm(bxTZSOStep.Sequence.Trim) & " and status <> 'D' order by seq", txTZSOStep)

                                      Call sql(c1, "ADG_SOEvent_Create" & SParm(bpes.CpnyID.Trim) & SParm("") & SParm("MSHP") & SParm("") & SParm("40110") & SParm(bSOShipHeader.ShipperID.Trim) & SParm(bpes.UserId))

                                      Call sql(c3, "EDSOShipHeader_EDAN_Insert" & SParm(bpes.CpnyID.Trim) & SParm(bSOShipHeader.ShipperID.Trim) & SParm("40110") & SParm(bpes.UserId))

                                  End If

  • Ajit Kannan Profile Picture
    Ajit Kannan 1,240 on at
    RE: Custom Order Steps using VB Tools

    Hi,

    In SL-2015, I tried to include a Custom executable ( we can include the custom SQL procedure as well with our logic)  in a order step. But it doesn't move to the next step though I have update the next function id in that executable.

    Is there a special way to move the order step.

    Thanks,

    Ajit Kannan S R

  • Suggested answer
    Apps Mexico Profile Picture
    Apps Mexico 1,090 on at
    RE: Custom Order Steps using VB Tools

    This lines of code can help you to do that:

                               Call Status(SaveGoodArgVals, False, "Actualizando Paso de Embarque: " & bxTZSOShipHeader.ShipperID.Trim, LOG_AND_DISP)

                               Call TranBeg(True)

                               serr6 = SqlFetch1(CSR_xTZSOStep, "select functionid, functionclass, seq from sostep where cpnyid = " & SParm(bpes.CpnyID.Trim) & " and sotypeid = " & SParm(bSOShipHeader.SOTypeID.Trim) & " and functionid = " & SParm(bSOShipHeader.NextFunctionID.Trim) & " and functionclass = " & SParm(bSOShipHeader.NextFunctionClass.Trim), bxTZSOStep)

                               serr7 = SqlFetch1(CSR_xTZSOStep, "select TOP 1 functionid, functionclass, seq from sostep where cpnyid = " & SParm(bpes.CpnyID.Trim) & " and sotypeid = " & SParm(bSOShipHeader.SOTypeID.Trim) & " and seq > " & SParm(bxTZSOStep.Sequence.Trim) & " and status <> 'D' order by seq", txTZSOStep)

                               Call sql(c1, "ADG_SOEvent_Create" & SParm(bpes.CpnyID.Trim) & SParm("") & SParm("MSHP") & SParm("") & SParm("40110") & SParm(bSOShipHeader.ShipperID.Trim) & SParm(bpes.UserId))

                               Call sql(c2, "ADG_SOEvent_Create" & SParm(bpes.CpnyID.Trim) & SParm("") & SParm("PINV") & SParm("") & SParm("40110") & SParm(bSOShipHeader.ShipperID.Trim) & SParm(bpes.UserId))

                               Call sql(c3, "EDSOShipHeader_EDAN_Insert" & SParm(bpes.CpnyID.Trim) & SParm(bSOShipHeader.ShipperID.Trim) & SParm("40110") & SParm(bpes.UserId))

                               Call sql(c4, "UPDATE SOShipHeader SET Lupd_DateTime = GETDATE(), NextFunctionID = " & SParm(txTZSOStep.FunctionID.Trim) & ", NextFunctionClass = " & SParm(txTZSOStep.FunctionClass.Trim) & " WHERE CpnyID = " & SParm(bpes.CpnyID.Trim) & " AND ShipperID = " & SParm(bSOShipHeader.ShipperID.Trim))

                               If (txTZSOStep.FunctionID.Trim = "4043000" AndAlso txTZSOStep.FunctionClass.Trim = "0100") OrElse serr7 = NOTFOUND Then

                                   If serr7 = 0 Then

                                       serr8 = SqlFetch1(CSR_xTZSOStep, "select functionid, functionclass, seq from sostep where cpnyid = " & SParm(bpes.CpnyID.Trim) & " and sotypeid = " & SParm(bSOShipHeader.SOTypeID.Trim) & " and functionid = " & SParm(txTZSOStep.FunctionID.Trim) & " and functionclass = " & SParm(txTZSOStep.FunctionClass.Trim), bxTZSOStep)

                                       serr9 = SqlFetch1(CSR_xTZSOStep, "select TOP 1 functionid, functionclass, seq from sostep where cpnyid = " & SParm(bpes.CpnyID.Trim) & " and sotypeid = " & SParm(bSOShipHeader.SOTypeID.Trim) & " and seq > " & SParm(bxTZSOStep.Sequence.Trim) & " and status <> 'D' order by seq", txTZSOStep)

                                       Call sql(c1, "ADG_SOEvent_Create" & SParm(bpes.CpnyID.Trim) & SParm("") & SParm("MSHP") & SParm("") & SParm("40110") & SParm(bSOShipHeader.ShipperID.Trim) & SParm(bpes.UserId))

                                       Call sql(c3, "EDSOShipHeader_EDAN_Insert" & SParm(bpes.CpnyID.Trim) & SParm(bSOShipHeader.ShipperID.Trim) & SParm("40110") & SParm(bpes.UserId))

                                   End If

                                   Call sql(c4, "UPDATE SOShipHeader SET Lupd_DateTime = GETDATE(), NextFunctionID = '', NextFunctionClass = '', Status = 'C', Lupd_Prog = '40400' WHERE CpnyID = " & SParm(bpes.CpnyID.Trim) & " AND ShipperID = " & SParm(bSOShipHeader.ShipperID.Trim))

                                   Call sql(c5, "UPDATE SOShipLine SET Lupd_DateTime = GETDATE(), Status = 'C', Lupd_Prog = '40400' WHERE CpnyID = " & SParm(bpes.CpnyID.Trim) & " AND ShipperID = " & SParm(bSOShipHeader.ShipperID.Trim))

                               End If

                               Call TranEnd()

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans