Question

Enable customer order number field in Completed state

  • 22 March 2024
  • 1 reply
  • 39 views

Userlevel 5
Badge +1

Is it possible to enable the Customer Order Nbr. field on the Sales Order form in the Completed state? I tried extending the SO workflow and adding the field under the state properties with the Disabled column unchecked but after publishing the field remained disabled.


1 reply

Userlevel 5
Badge

I would advise taking a look at the solution below on how to do it.

In short, I believe you require:

  1. An extended workflow with editable fields under required state with Disabled = unticked
  2. Code to enable the field.

Here is a sample for our SOOrderEntry which has been customised to enable editing of price and ext price. This is to amend SOLine though, so Order Number may require some tweaking.

 

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using PX.Common;
using PX.Data;
using PX.Objects.AP;
using PX.Objects.AR;
using PX.Objects.CA;
using PX.Objects.CM;
using PX.Objects.CR;
using PX.Objects.CS;
using PX.Objects.DR;
using PX.Objects.EP;
using PX.Objects.GL;
using PX.Objects.IN;
using PX.Objects.PM;
using PX.Objects.PO;
using PX.Objects.TX;
using POLine = PX.Objects.PO.POLine;
using POOrder = PX.Objects.PO.POOrder;
using System.Threading.Tasks;
using PX.CarrierService;
using CRLocation = PX.Objects.CR.Standalone.Location;
using PX.Objects.AR.CCPaymentProcessing;
using PX.Objects.AR.CCPaymentProcessing.Common;
using PX.Objects.AR.CCPaymentProcessing.Helpers;
using PX.Objects.AR.CCPaymentProcessing.Interfaces;
using ARRegisterAlias = PX.Objects.AR.Standalone.ARRegisterAlias;
using PX.Objects.AR.MigrationMode;
using PX.Objects.Common;
using PX.Objects.Common.Discount;
using PX.Objects.Common.Extensions;
using PX.Objects.IN.Overrides.INDocumentRelease;
using PX.CS.Contracts.Interfaces;
using Message = PX.CarrierService.Message;
using PX.TaxProvider;
using PX.Data.DependencyInjection;
using PX.Data.WorkflowAPI;
using PX.LicensePolicy;
using PX.Objects.Extensions.PaymentTransaction;
using PX.Objects.SO.GraphExtensions.CarrierRates;
using PX.Objects.SO.GraphExtensions.SOOrderEntryExt;
using PX.Objects.SO.Attributes;
using PX.Objects.Common.Attributes;
using PX.Objects.Common.Bql;
using OrderActions = PX.Objects.SO.SOOrderEntryActionsAttribute;
using PX.Objects.SO.DAC.Projections;
using PX.Data.BQL.Fluent;
using PX.Objects;
using PX.Objects.SO;

namespace PX.Objects.SO
{
  public class SOOrderEntry_Extension : PXGraphExtension<PX.Objects.SO.SOOrderEntry>
  {
    #region Event Handlers
        protected virtual void SOLine_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
        {
            InvokeBaseHandler?.Invoke(cache, e);
            SOLine row = e.Row as SOLine;
            if (row != null)
            {
                Base.Document.Cache.AllowUpdate = true;
                PXUIFieldAttribute.SetEnabled<SOLine.curyUnitPrice>(cache, row, true);
                PXUIFieldAttribute.SetEnabled<SOLine.curyExtPrice>(cache, row, true);
                
            }
        }
    #endregion
  }
}

 

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