Skip to content

Instantly share code, notes, and snippets.

@kjrichardson
Last active February 17, 2023 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjrichardson/698684c2c1806fdd437abb7dd457627a to your computer and use it in GitHub Desktop.
Save kjrichardson/698684c2c1806fdd437abb7dd457627a to your computer and use it in GitHub Desktop.
SOOrderEntryIsCopyOrderExt Acumatica
[PXProtectedAccess(typeof(SOOrderEntry))]
public abstract class SOOrderEntryIsCopyOrderExt : PXGraphExtension<SOOrderEntry>
{
[PXProtectedAccess]
public abstract bool IsCopyOrder { get; set; }
}
public class SOOrderEntry_Extension : PXGraphExtension<SOOrderEntryIsCopyOrderExt, SOOrderEntry>
{
//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
Base1.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
{
Base1.IsCopyOrder = false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment