Question

REST API - Raising PXSetPropertyException from RowUpdating Event

  • 18 November 2022
  • 0 replies
  • 24 views

Hello!

Currently, if a PXSetPropertyException is thrown from the FieldVerifying event, the error is packaged up nicely for the specific field under an “error” property on the field in the response with a status code 422.

 

What I’d like to do is validate multiple fields on an SO Line using the RowUpdating/Inserting/Deleting events, and if a field fails validation have the response come back in that same way.

 

Based on the framework docs I’ve tried this on the SO line, but the response comes back with status code 500:

sender.RaiseExceptionHandling<SOLine.inventoryId>(
line, line.InventoryId,
new PXSetPropertyException("failed validation."));
e.Cancel = true;

Is this even possible or does it require that the PXSetPropertyException be thrown from the FieldVerifying event?


0 replies

Be the first to reply!

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 — 2022  Acumatica, Inc. All rights reserved