Skip to main content
Solved

Creating a shipment with a wrong shipment number prefix (brand Id problem)

  • 11 December 2020
  • 3 replies
  • 132 views

SadokHanini
Freshman II

Using this code, accumatica create my new SOShipment from the new SOOrder. The new SOShipment is associated in New BranchId and that we need extactly.

Problem : the ShipmentNbr of new SOShipment get the perfix of the Old BranchId

SOShipmentEntry soShipmentGraph = PXGraph.CreateInstance<SOShipmentEntry>();

soShipmentGraph.Clear();

DocumentList<SOShipment> created = new DocumentList<SOShipment>(soShipmentGraph);

SOShipment sOShipment = new SOShipment();

created.Add(sOShipment);

soShipmentGraph.CreateShipment(newOrder,5, newOrder.OrderDate, true, SOOperation.Issue, created);

 

Best answer by Naveen Boga

Hi @SadokHanini 

 

As you are creating shipment from one branch to another branch. Please use the below code to set the current Branch and then have logic for creating the shipment.

int branchObj = 2; 
 PXContext.SetBranchID(branchObj);

Hope this helps !!

 

Best Regards,

Naveen B

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

3 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • December 13, 2020

Hi @SadokHanini 

Can you please also share the source code that you are creating Sales Orders from one branch to other branch.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • Answer
  • December 15, 2020

Hi @SadokHanini 

 

As you are creating shipment from one branch to another branch. Please use the below code to set the current Branch and then have logic for creating the shipment.

int branchObj = 2; 
 PXContext.SetBranchID(branchObj);

Hope this helps !!

 

Best Regards,

Naveen B


SadokHanini
Freshman II
  • Author
  • Freshman II
  • 42 replies
  • December 15, 2020
naveenb74 wrote:

Hi @SadokHanini 

 

As you are creating shipment from one branch to another branch. Please use the below code to set the current Branch and then have logic for creating the shipment.

int branchObj = 2; 
 PXContext.SetBranchID(branchObj);

Hope this helps !!

 

Best Regards,

Naveen B

It’s Working Thanks :) 


Reply


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