Solved

Update existing open shipment(Add new sales order to an existing open shipment)


Userlevel 4
Badge +1

Hi, 

 

I want to add a new order to an existing open shipment by overriding create shipment action from SO order screen instead of creating new shipment. How Can I do this? Can you provide any code examples to do this.

 

Thanks

icon

Best answer by Raj Gopinathan 16 August 2022, 16:45

View original

10 replies

Userlevel 4
Badge +1

@Naveen Boga Can You Help plz?

Userlevel 3
Badge

Can you not do it from the Shipment screen Details section where you have the option to “Add Order”? 

Userlevel 4
Badge +1

@Raj Gopinathan Yes, But how to do it through the code when I Click Create Shipment Action in Sales Order Screen?

Userlevel 7
Badge +17

Hi @charithalakshan49  You can use the ADD ORDER option from the Details section below.

Which can pull the orders, which order having the same Customer ID and Warehouse.

 

 

Userlevel 3
Badge

Ok, if you have to go only from Sales Order screen, you could probably create a new action to lookup open Shipments for the Customer and then select the Shipment to link it up to. Logic wise you could follow what is being done in the “Add Order” action on Shipment screen where that action shows all open orders for the Customer and lets you link it to the Shipment.

 

If there is particular reasoning for only using Create Shipment Action, can you elaborate the requirement? It may not be advisable to do such a customization as it might potentially break during upgrades.

Userlevel 4
Badge +1

@Raj Gopinathan Yes. the requirement is to check for a shipment with total order amount less than certain value(lets say $30). if such shipment found, then we need to add the new order to that shipment. otherwise a new shipment need to be created for the new order.

Userlevel 3
Badge

There are multiple factors you should consider here with respect to the business process, say how will this be handled in bulk Shipment creation from the processing screen, if there will be drop ship orders, partial shipments, Order Type (Ship Separately setting) etc. Also how will these orders be entered - via screen or are they created through an interface? If these orders will be user entered via screen, I’d still recommend creating a separate action to lookup shipments and you could even disable the “Create Shipment” action for orders less than $30 until the other action is invoked and no existing Shipments found. The create shipment action could be placed inside the (new) shipment selector popup dialog and enabled if no shipments found. Just thinking out loud here and I do not have any ready code examples to share.

Userlevel 6
Badge +5

I don’t have a code example but you should be able to:

  1. create an instance of the SOShipmentEntry graph
  2. find the shipment you want to add the order to
  3. set the current document on the SOShipmentEntry graph to the shipment
  4. set the necessary parameters on the addsofilter view
  5. call the AddSO action on the SOShipmentEntry graph
  6. save the shipment

That being said as @Raj Gopinathan mentioned there are a number of related implications to consider before customizing the CreateShipment action. Based on your above requirements creating an additional action when the conditions are right and then disabling the base CreateShipment action might make for better UX(an additional custom action would make it clear to the user that a new shipment was not being create) and maintainability. If you are on a more recent version of Acumatica you can even add connotations to make it clear to the user that they need to use this custom action.

Userlevel 4
Badge +1

@markusray17 @Raj Gopinathan Thanks for the help. However, I am still struggling to set parameters in addsofilter view

Userlevel 6
Badge +5

Are you getting a specific error or can you share the code where you are having issues?

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved