Skip to main content
Solved

Overriding Sales Order status 'Shipping' Field Availability

  • October 10, 2024
  • 4 replies
  • 140 views

Forum|alt.badge.img+9

Hello everyone,

 

I am looking to change the UI availability for the editing of fields when a Sales Order is in shipping.

I have moved the Credit Hold stage to the Shipment stage because of how our business processes work, we process and manufacture Sales Orders but do not ship until the leadership team is satisfied with payments.

 

I am aware that I can make the fields editable through a RowSelected handler, however, would it be better to override the DisableWholeScreen method which is used in the SO workflow to make these fields editable.

Another condition that needs to be satisfied is that the Qty on Shipments field cannot be higher than 0, for the fields to be editable, I am not sure if I can put a condition into a workflow .WithFieldAssignments method.

 

Could someone advise on what the best way to go forward with this would be.

 

Thanks,

Aleks

Best answer by aiwan

Hello everyone,

 

Thanks to @Keith Richardson @Samvel Petrosov and some others. 

I removed the shipment flow state from the SO workflow with the Workflow API and added it back with an amended method to disable fields.

Original method:

public static void DisableWholeScreen(FieldState.IContainerFillerFields states)
{
states.AddTable<SOOrder>(state => state.IsDisabled());
states.AddTable<SOLine>(state => state.IsDisabled());
states.AddTable<SOTaxTran>(state => state.IsDisabled());
states.AddTable<SOBillingAddress>(state => state.IsDisabled());
states.AddTable<SOBillingContact>(state => state.IsDisabled());
states.AddTable<SOShippingAddress>(state => state.IsDisabled());
states.AddTable<SOShippingContact>(state => state.IsDisabled());
states.AddTable<SOLineSplit>(state => state.IsDisabled());
states.AddTable<CRRelation>(state => state.IsDisabled());
}

My method:

public static void EnableSOLine(FieldState.IContainerFillerFields states)
{
states.AddTable<SOOrder>(state => state.IsDisabled());
states.AddTable<SOTaxTran>(state => state.IsDisabled());
states.AddTable<SOBillingAddress>(state => state.IsDisabled());
states.AddTable<SOBillingContact>(state => state.IsDisabled());
states.AddTable<SOShippingAddress>(state => state.IsDisabled());
states.AddTable<SOShippingContact>(state => state.IsDisabled());
states.AddTable<CRRelation>(state => state.IsDisabled());
}

Below is what I did to remove and then add back the shipment stage to the SO workflow:

public sealed override void Configure(PXScreenConfiguration config)
{
Configure(config.GetScreenConfigurationContext<SOOrderEntry,
SOOrder>());
}

protected static void Configure(WorkflowContext<SOOrderEntry,
SOOrder> context)
{
context.UpdateScreenConfigurationFor(screen => screen
.WithFlows(flows =>
{
flows.Update<SOBehavior.sO>(flow => flow
.WithFlowStates(flowStates =>
{
flowStates.Remove<State.shipping>();
flowStates.Add<State.shipping>(flowState =>
{
return flowState
.WithActions(actions =>
{
actions.Add(g => g.createShipmentIssue);
actions.Add(g => g.emailSalesOrder);
actions.Add(g => g.createPurchaseOrder);
actions.Add<CreatePaymentExt>(e => e.createAndCapturePayment);
actions.Add<CreatePaymentExt>(e => e.createAndAuthorizePayment);
})
.WithEventHandlers(handlers =>
{
handlers.Add(g => g.OnShipmentUnlinked);
handlers.Add(g => g.OnShipmentConfirmed);
})
.WithFieldStates(EnableSOLine);
});
}));
}));
}

Hope this helps someone in the future!

Aleks

4 replies

Forum|alt.badge.img+9
  • Author
  • Captain II
  • Answer
  • October 15, 2024

Hello everyone,

 

Thanks to @Keith Richardson @Samvel Petrosov and some others. 

I removed the shipment flow state from the SO workflow with the Workflow API and added it back with an amended method to disable fields.

Original method:

public static void DisableWholeScreen(FieldState.IContainerFillerFields states)
{
states.AddTable<SOOrder>(state => state.IsDisabled());
states.AddTable<SOLine>(state => state.IsDisabled());
states.AddTable<SOTaxTran>(state => state.IsDisabled());
states.AddTable<SOBillingAddress>(state => state.IsDisabled());
states.AddTable<SOBillingContact>(state => state.IsDisabled());
states.AddTable<SOShippingAddress>(state => state.IsDisabled());
states.AddTable<SOShippingContact>(state => state.IsDisabled());
states.AddTable<SOLineSplit>(state => state.IsDisabled());
states.AddTable<CRRelation>(state => state.IsDisabled());
}

My method:

public static void EnableSOLine(FieldState.IContainerFillerFields states)
{
states.AddTable<SOOrder>(state => state.IsDisabled());
states.AddTable<SOTaxTran>(state => state.IsDisabled());
states.AddTable<SOBillingAddress>(state => state.IsDisabled());
states.AddTable<SOBillingContact>(state => state.IsDisabled());
states.AddTable<SOShippingAddress>(state => state.IsDisabled());
states.AddTable<SOShippingContact>(state => state.IsDisabled());
states.AddTable<CRRelation>(state => state.IsDisabled());
}

Below is what I did to remove and then add back the shipment stage to the SO workflow:

public sealed override void Configure(PXScreenConfiguration config)
{
Configure(config.GetScreenConfigurationContext<SOOrderEntry,
SOOrder>());
}

protected static void Configure(WorkflowContext<SOOrderEntry,
SOOrder> context)
{
context.UpdateScreenConfigurationFor(screen => screen
.WithFlows(flows =>
{
flows.Update<SOBehavior.sO>(flow => flow
.WithFlowStates(flowStates =>
{
flowStates.Remove<State.shipping>();
flowStates.Add<State.shipping>(flowState =>
{
return flowState
.WithActions(actions =>
{
actions.Add(g => g.createShipmentIssue);
actions.Add(g => g.emailSalesOrder);
actions.Add(g => g.createPurchaseOrder);
actions.Add<CreatePaymentExt>(e => e.createAndCapturePayment);
actions.Add<CreatePaymentExt>(e => e.createAndAuthorizePayment);
})
.WithEventHandlers(handlers =>
{
handlers.Add(g => g.OnShipmentUnlinked);
handlers.Add(g => g.OnShipmentConfirmed);
})
.WithFieldStates(EnableSOLine);
});
}));
}));
}

Hope this helps someone in the future!

Aleks


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • October 15, 2024

Thank you for sharing your solution with the community @aiwan!


Forum|alt.badge.img
  • Freshman I
  • May 15, 2026

We also have the need to make some fields editable when an order is in shipping status, but before I look at changing this I want to understand why Acumatica locks the ENTIRE sales order screen in this status and not just the lines currently on the shipment.

any insight to this?


Forum|alt.badge.img+9
  • Author
  • Captain II
  • May 15, 2026

I think it is to do with data integrity, I recommend thorough testing with changes like this.

We ran this on our sandbox alongside regular orders for about a month to make sure it works as intended.

 

I think that as long as you put the right controls in, i.e. disabling any fields that can affect the shipment (SOLines on a shipment, the addresses/contacts) there shouldn’t be any issues.