Skip to content

Instantly share code, notes, and snippets.

@jvanhoesen
Last active November 24, 2020 21: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 jvanhoesen/58a2c6105789c632994d51a87fce3b24 to your computer and use it in GitHub Desktop.
Save jvanhoesen/58a2c6105789c632994d51a87fce3b24 to your computer and use it in GitHub Desktop.
Status field and attribute declaration
public class AATimeRequestStatus
{
public const string OnHold = "H";
public const string PendingApproval = "P";
public const string Approved = "A";
public const string Rejected = "R";
public class onHold : BqlString.Constant<onHold>
{
public onHold() : base(OnHold)
{
}
}
public class pendingApproval : BqlString.Constant<pendingApproval>
{
public pendingApproval() : base(PendingApproval)
{
}
}
public class approved : BqlString.Constant<approved>
{
public approved() : base(Approved)
{
}
}
public class rejected : BqlString.Constant<rejected>
{
public rejected() : base(Rejected)
{
}
}
public class AATimeRequestStatusListAttribute : PXStringListAttribute
{
public AATimeRequestStatusListAttribute() : base(
new string[]
{
OnHold,
PendingApproval,
Approved,
Rejected
},
new string[]
{
"On Hold",
"Pending Approval",
"Approved",
"Rejected"
})
{
}
}
}
//Use of attribute on status field decleration
#region Status
public abstract class status : BqlString.Field<status>
{
}
[PXDBString(1, IsFixed = true)]
[PXDefault(AATimeRequestStatus.OnHold)]
[AATimeRequestStatus.AATimeRequestStatusList]
[PXUIField(DisplayName = "Status")]
public virtual string Status { get; set; }
#endregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment