Skip to main content
Answer

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

  • January 2, 2022
  • 2 replies
  • 322 views

aaghaei
Captain II
Forum|alt.badge.img+10

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

 

Best answer by ChandraM

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

2 replies

Forum|alt.badge.img+8
  • Semi-Pro I
  • Answer
  • January 2, 2022

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


aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • January 2, 2022

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.