Skip to content

Instantly share code, notes, and snippets.

@jvanhoesen
Created November 24, 2020 21:40
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 jvanhoesen/dcf6fe87eb6ae25a214a2657066301a6 to your computer and use it in GitHub Desktop.
Save jvanhoesen/dcf6fe87eb6ae25a214a2657066301a6 to your computer and use it in GitHub Desktop.
Primary Data-Access-Class FieldUpdated
/// <summary>
/// Sets a document to pending approval when taken off hold, or resets the other status fields when a document is put back on hold
/// </summary>
protected virtual void _(Events.FieldUpdated<AATimeRequest, AATimeRequest.hold> e)
{
if (e.Row is AATimeRequest row)
{
if (!row.Hold ?? false)
{
row.Status = AATimeRequestStatus.PendingApproval;
}
else
{
row.Status = AATimeRequestStatus.OnHold;
row.Rejected = false;
row.Approved = false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment