I have added a custom field to AP Bills that entering value should be mandatory. On the AP Bill screen system shows a red astrix by the field label that when value entered turns its color to black. But system doesn’t force the user to enter value for it and accepts saving the form without having data in this field. I have made it “Required” as you can see below. Why?
Here is the field definiatin:
#region UsrCFApprovalRouteID
public abstract class usrCFApprovalRouteID : PX.Data.BQL.BqlInt.Field<usrCFApprovalRouteID> { }
protected Int32? _UsrCFApprovalRouteID;
>PXDBInt()]
>PXDefault(typeof(Search<SMUserPreferences_Extension.usrCFDefaultApprovalRouteID,
Where<UserPreferences.userID, Equal<Current<AccessInfo.userID>>>>),
PersistingCheck = PXPersistingCheck.Nothing)]
>PXSelector(typeof(Search<UDCTEPApprovalRoute.approvalRouteID,
Where<UDCTEPApprovalRoute.isActive, NotEqual<False>>,
OrderBy<Asc<UDCTEPApprovalRoute.approvalRouteCD>>>),
typeof(UDCTEPApprovalRoute.approvalRouteCD),
typeof(UDCTEPApprovalRoute.routeName),
typeof(UDCTEPApprovalRoute.isActive),
SubstituteKey = typeof(UDCTEPApprovalRoute.approvalRouteCD),
DescriptionField = typeof(UDCTEPApprovalRoute.routeName),
ValidateValue = false)]
>PXUIField(DisplayName = "Approval Route", Required = true, Enabled = true, Visibility = PXUIVisibility.SelectorVisible)]
public virtual Int32? UsrCFApprovalRouteID
{
get
{
return this._UsrCFApprovalRouteID;
}
set
{
this._UsrCFApprovalRouteID = value;
}
}
#endregion