Solved

Acumatica and Sales Order Screen - Create Shipment

  • 11 March 2023
  • 6 replies
  • 224 views

I am trying to find a way to modify the "Specify Shipment Parameters" dialog (that displays when you click the "CREATE SHIPMENTS" action).

I need to modify the default value for the Shipment Date. (based on a customer request).

                       [Sales Orders screen - CREATE SHIPMENT action]
 

So far: I have looked through Stack overflow and the Acumatica Community forum for suggestions.

I have also looked through the Acumatica SOOrderEntry.cs source-code.

 

Starting on line: 523 (SOOrderEntry.cs) Near the bottom of this code fragment, is the code: soparamfilter.AskExt(true); I believe that line executes the "Specify Shipment Parameters" dialog.

 

public PXAction<SOOrder> createShipment; [PXButton(CommitChanges = true), PXUIField(DisplayName = OrderActions.DisplayNames.CreateShipment, MapEnableRights = PXCacheRights.Select, Visible = false)]

protected virtual IEnumerable CreateShipment(PXAdapter adapter,
      [PXDate] DateTime? shipDate,
      [PXInt] int? siteID,
      [SOOperation.List] string operation) {
      List<SOOrder> list = adapter.Get<SOOrder>().ToList();

      if (shipDate != null)
          soparamfilter.Current.ShipDate = shipDate;

      if (siteID != null)
          soparamfilter.Current.SiteID = siteID;

      if (soparamfilter.Current.ShipDate == null)
          soparamfilter.Current.ShipDate = Accessinfo.BusinessDate;

      if (!adapter.MassProcess)
      {
           if (soparamfilter.Current.SiteID == null)
                soparamfilter.Current.SiteID = GetPreferedSiteID();
           if (adapter.ExternalCall) soparamfilter.AskExt(true)
      }

 

Thank you for any suggestion you may have. I really appreciate it.

icon

Best answer by aaghaei 11 March 2023, 04:42

View original

6 replies

Userlevel 7
Badge +8

What do you want the default value be? You might be able to customize (assuming you are familiar with customization) without altering the action’s method by modifying the DAC field’s properties or catch attached event.

Pseudo: <Shipping date> + <365 days>

ShipDate = ((DateTime)ShipDate).AddDays(365);

 

Thank you.

Userlevel 7
Badge +8

Create a DAC Extension for your filter DAC (SOParamFilter) copy the ShipDate field properties and replace the default and publish and you are good to go

// Declare a desired number of additional days
public class AdditionalDays : PX.Data.BQL.BqlInt.Constant<AdditionalDays>
{
public AdditionalDays() : base(365) { }
}


// Overide the Date Default Value
[PXDefault(typeof(Add<SOOrder.shipDate.FromCurrent, AdditionalDays>), PersistingCheck = PXPersistingCheck.Nothing)]

 

Thank You for your help Aaghael !

Reza Aghaei = Best Answer!

Userlevel 7
Badge +8

@ken29 My Pleasure. Glad I could.

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