Created
September 28, 2021 13:55
-
-
Save BrianMRO/1fb4359ee10b740c3d25d0b05e55f288 to your computer and use it in GitHub Desktop.
Approval Optional
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
#region RemoveHold Action | |
public PXAction<MyDAC> RemoveHold; | |
[PXButton(CommitChanges = true), PXUIField(DisplayName = Messages.RemoveHold)] | |
protected virtual IEnumerable removeHold(PXAdapter adapter) | |
{ | |
MyDAC myRecord = Document.Current; | |
if (myRecord != null) | |
{ | |
// Set the RequestApproval field | |
Document.SetValueExt<MyDAC.requestApproval>(myRecord, RequireApproval(myRecord)); | |
Document.Update(myRecord); | |
// Refresh the SetupApproval view so the logic in the constructor clears the | |
// maps to prevent approval or retrieves the list of approval maps to consider | |
SetupApproval.View.RequestRefresh(); | |
} | |
return adapter.Get(); | |
} | |
#endregion | |
#region RequireApproval | |
protected virtual bool? RequireApproval(MyDAC myRecord) | |
{ | |
// Logic to decide if approval is required | |
// Return True if approval should be requried | |
// Return False if approval should not be required | |
} | |
#endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment