Solved

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

  • 2 January 2022
  • 2 replies
  • 269 views

Userlevel 7
Badge +8

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

 

icon

Best answer by ChandraM 2 January 2022, 18:49

View original

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 +8

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


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved