Skip to main content
Solved

confirm Shipment via code

  • November 23, 2020
  • 4 replies
  • 312 views

Hello,

How to confirm Shipment or Receipt via code?

Best regards.

 

Best answer by Naveen Boga

Hi @mohamed1walha,

Please use the below code to confirm the shipment.

 

 PXAutomation.CompleteSimple(soShipmentGraph.Document.View);
                        PXAdapter adapter2 = new PXAdapter(new DummyView(soShipmentGraph, soShipmentGraph.Document.View.BqlSelect,
                                             new List<object> { soShipmentGraph.Document.Current }));
                        adapter2.Menu = "Confirm Shipment";
                        adapter2.Arguments = new Dictionary<string, object>();
                        adapter2.Arguments.Add("actionID", 1);
                        soShipmentGraph.action.PressButton(adapter2);
                        TimeSpan timespan;
                        Exception ex;
                        while (PXLongOperation.GetStatus(soShipmentGraph.UID, out timespan, out ex) == PXLongRunStatus.InProcess)
                        { }
                        PXAutomation.GetStep(soShipmentGraph, new List<object> { soShipmentGraph.Document.Current }, soShipmentGraph.Document.View.BqlSelect);

                        PXAutomation.CompleteAction(soShipmentGraph);
                        PXLongOperation.WaitCompletion(soShipmentGraph.UID);
                        PXAutomation.GetStep(soShipmentGraph, new List<object> { soShipmentGraph.Document.Current }, soShipmentGraph.Document.View.BqlSelect);
                        soShipmentGraph.Save.Press();
                        PXLongOperation.ClearStatus(soShipmentGraph.UID);

 

 

Best Regards,

Naveen B

View original
Did this topic help you find an answer to your question?

4 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3410 replies
  • Answer
  • November 23, 2020

Hi @mohamed1walha,

Please use the below code to confirm the shipment.

 

 PXAutomation.CompleteSimple(soShipmentGraph.Document.View);
                        PXAdapter adapter2 = new PXAdapter(new DummyView(soShipmentGraph, soShipmentGraph.Document.View.BqlSelect,
                                             new List<object> { soShipmentGraph.Document.Current }));
                        adapter2.Menu = "Confirm Shipment";
                        adapter2.Arguments = new Dictionary<string, object>();
                        adapter2.Arguments.Add("actionID", 1);
                        soShipmentGraph.action.PressButton(adapter2);
                        TimeSpan timespan;
                        Exception ex;
                        while (PXLongOperation.GetStatus(soShipmentGraph.UID, out timespan, out ex) == PXLongRunStatus.InProcess)
                        { }
                        PXAutomation.GetStep(soShipmentGraph, new List<object> { soShipmentGraph.Document.Current }, soShipmentGraph.Document.View.BqlSelect);

                        PXAutomation.CompleteAction(soShipmentGraph);
                        PXLongOperation.WaitCompletion(soShipmentGraph.UID);
                        PXAutomation.GetStep(soShipmentGraph, new List<object> { soShipmentGraph.Document.Current }, soShipmentGraph.Document.View.BqlSelect);
                        soShipmentGraph.Save.Press();
                        PXLongOperation.ClearStatus(soShipmentGraph.UID);

 

 

Best Regards,

Naveen B


  • Author
  • Jr Varsity II
  • 22 replies
  • November 23, 2020

thank's @naveenb74 


  • Author
  • Jr Varsity II
  • 22 replies
  • November 26, 2020

Resolved.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3410 replies
  • November 26, 2020

@mohamed1walha  Awesome :)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings