Skip to main content
Solved

Acumatica and Sales Order Screen - Create Shipment

  • Mar 11, 2023 2:48 AM UTC
  • 6 replies
  • 465 views
  • Translate All

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

6 replies

aaghaei
Captain II
Forum|alt.badge.img+11
  • Captain II
  • Mar 11, 2023 2:54 AM UTC

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.

Translate

  • Author
  • Freshman I
  • Mar 11, 2023 3:01 AM UTC

Pseudo: <Shipping date> + <365 days>

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

 

Thank you.

Translate

aaghaei
Captain II
Forum|alt.badge.img+11
  • Captain II
  • Answer
  • Mar 11, 2023 3:42 AM UTC

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

 

Translate

  • Author
  • Freshman I
  • Mar 14, 2023 12:29 AM UTC

Thank You for your help Aaghael !

Translate

  • Author
  • Freshman I
  • Mar 14, 2023 12:31 AM UTC

Reza Aghaei = Best Answer!

Translate

aaghaei
Captain II
Forum|alt.badge.img+11
  • Captain II
  • Mar 14, 2023 12:32 AM UTC

@ken29 My Pleasure. Glad I could.

Translate