Skip to main content
Solved

Acumatica and Sales Order Screen - Create Shipment


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.

Best answer by aaghaei

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)]

 

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

6 replies

aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • 1202 replies
  • March 11, 2023

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.


  • Author
  • Freshman I
  • 3 replies
  • March 11, 2023

Pseudo: <Shipping date> + <365 days>

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

 

Thank you.


aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • 1202 replies
  • Answer
  • March 11, 2023

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)]

 


  • Author
  • Freshman I
  • 3 replies
  • March 14, 2023

Thank You for your help Aaghael !


  • Author
  • Freshman I
  • 3 replies
  • March 14, 2023

Reza Aghaei = Best Answer!


aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • 1202 replies
  • March 14, 2023

@ken29 My Pleasure. Glad I could.


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