Skip to content

Instantly share code, notes, and snippets.

@kjrichardson
Created February 17, 2023 20:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kjrichardson/04642c509aa3849b1fafeafd8ecaf56f to your computer and use it in GitHub Desktop.
SOOrderEntry_Extension
[PXProtectedAccess(typeof(SOOrderEntry))]
public abstract class SOOrderEntry_Extension : PXGraphExtension<SOOrderEntry>
{
//declare the abstract protected access property as public
[PXProtectedAccess]
public abstract bool IsCopyOrder { get; set; }
//custom copy order class that is called from a process/action that is different than the standard copy order process
public virtual void CopyAutoOrder(SOOrder sourceOrder, CopyParamFilter copyFilter, HWAutoOrder autoOrder)
{
Base.Save.Press();
SOOrder order = PXCache<SOOrder>.CreateCopy(sourceOrder);
//set the copy order flag to true
IsCopyOrder = true;
//set our auto order flag
IsAutoOrder = true;
try
{
//call base copy order proc that the action calls.
Base.CopyOrderProc(sourceOrder, copyFilter);
//set additional properties from other fields on the SO Order to their proper fields
//save the order
}
catch { }
finally
{
IsCopyOrder = false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment