Tuesday, June 9, 2015

Adding Verification Logic to a Field

Hi Guys,

There is a common customization task to add some piece of business logic to a field.
Here is the example of adding verification to a Journal Transaction screen.

In short, for certain Accounts (Expense and Income) I will need to check that user entered Customer or Vendor into Journal Transaction screen. Balance Sheet accounts should be skipped.

Here is how it supposed to look like:


Thanks to a reworked Acumatica API documentation, it was not a Rocket Science to develop a simple piece of code below that covers this logic:


Please take note of:

sender.RaiseExceptionHandling<GLTran.referenceID>(e.Row, row.ReferenceID, new PXSetPropertyException(ErrorMessages.FieldIsEmpty , PXErrorLevel.RowError, typeof(GLTran.referenceID).Name));

That identifies where exactly to show a red cross Error.

All the Best,

Sergey.

No comments:

Post a Comment