Skip to main content
Solved

Not able to make the system force entring required fields by the user

  • 2 January 2022
  • 2 replies
  • 290 views

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

 

2 replies

Userlevel 7
Badge +9

Hi @aaghaei Please find the below link for making a field as Required.

https://stackoverflow.com/questions/47933636/how-do-you-mark-a-field-as-required-in-acumatica

Thanks

Userlevel 7
Badge +9

Thanks @ChandrasekharM 

so based on the post considering my field type is int, all I have to do is to change PersistingCheck = PXPersistingCheck.Nothing to PersistingCheck = PXPersistingCheck.Null

will try to see how it works out.

Reply