/SOOrderEntry_Extension.cs Secret
Created
February 17, 2023 20:22
Star
You must be signed in to star a gist
SOOrderEntry_Extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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