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
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
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
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()
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156