How To Validate Input On Insert
24 August 2017
Hello everybody,
today I want to document small feature in Acumatica which I can call validation of insert.
As usually if you need to validate some logic of insertion you can use something like RowXXXXd event. But for simple validations you can use PXUIVerify attribute. Below goes example take from Acumatica itself:
[PXUIVerify(typeof (Where<LandedCostTran.curyLCAmount, NotEqual<decimal0>>),
PXErrorLevel.Error, "The value must be greater than zero", new System.Type[] {}, CheckOnInserted = false)]
What this command says to you is pretty obvious:
Verify at ui level ( generate javascript verification code ) that value at LandedCostTran.CuryLCAmount is not equal to zero.
CheckOnInserted = false says that checking on insertion should not be done.