Hi Everyone,
Can you please help me with the sample code to override the Quick Process Action in the Sales Orders screen?
Hi Everyone,
Can you please help me with the sample code to override the Quick Process Action in the Sales Orders screen?
Best answer by Naveen Boga
using System.Collections;
using PX.Data;
using PX.Objects.SO;
using static PX.Objects.SO.SOOrderEntry;
namespace CreateBuild
{
public class SOOrderEntry_Extension : PXGraphExtension<SOQuickProcess, SOOrderEntry>
{
public static bool IsActive() => true;
public delegate IEnumerable QuickProcessOkDelegate(PXAdapter adapter);
[PXOverride]
public IEnumerable QuickProcessOk(PXAdapter adapter, QuickProcessOkDelegate baseMethod)
{
SOQuickProcessParameters parameters = Base1.QuickProcessParameters.Current;
SOOrder order = Base.Document.Current;
if (order != null &&
parameters?.GetExtension<SOQuickProcessParametersExt>()?.MyField == true)
{
Base.Document.Cache.SetValueExt<SOOrder.orderDesc>(order, "TEST QUICK PROCESS");
Base.Document.Update(order);
Base.Save.Press();
}
return baseMethod(adapter);
}
}
}Hope this helps!!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.