Ken S.
Ken S.

Reputation: 1

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 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 list = adapter.Get().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.

Upvotes: 0

Views: 141

Answers (1)

Chris H
Chris H

Reputation: 765

A simple answer is to modify the default value. Create the SOOrderEntry graph extension. Then write the event handler for SOParamFilter defaulting method like this

public void SOParamFilter_SiteID_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
{
    e.NewValue = null;
}

Be aware a value is required. The same applies for the date.

public void SOParamFilter_ShipDate_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
{
    e.NewValue = Base.Accessinfo.BusinessDate.Value.AddDays(30);
}

enter image description here

Upvotes: 0

Related Questions