Question

Show error field in multi row

  • 19 June 2023
  • 4 replies
  • 110 views

Userlevel 3
Badge

 

Hi Expert.

 I use RowPersisting to validate row and set error by:

PXUIFieldAttribute.SetError<EPTimeCardSummary.earningType>(cache, row, null);

                        cache.RaiseExceptionHandling<EPTimeCardSummary.earningType>(e.Row, row.EarningType, new PXSetPropertyException(String.Format(ConstantsEP.MsgEarningType, item.EarningType, contr.ContractCD.Trim(), PXErrorLevel.Error)));

  Now i want show error field in multi row (above image). How i do that?

 Thank you so much.


4 replies

Userlevel 7
Badge +9

You will need to develop the logic on EPTimeCard (the header) to loop through the items and set the error on each line which is meeting the criteria.

Userlevel 7
Badge +17

Hi, @thanhaim  Assuming that your requirement is NOT to allow the duplicate rows in the GRID.

If yes, please use the PXCheckUnique attribute at the DAC level to validate the duplicate records and display the error.

Here are the links for reference and hope this helps.

https://www.crestwood.com/2018/06/30/acumatica-pxcheckunique/

https://stackoverflow.com/questions/51646620/acumatica-pxcheckunique-how-to-display-duplicate-order-nbr-on-the-error-messag

 

Userlevel 3
Badge

Hi @Naveen Boga @aaghaei . I loop each row In EPTimeCard  and check condition, if a row invalid a set error:

PXUIFieldAttribute.SetError<EPTimeCardSummary.earningType>(cache, row, null);



 cache.RaiseExceptionHandling<EPTimeCardSummary.earningType>(e.Row, row.EarningType, new PXSetPropertyException(String.Format(ConstantsEP.MsgEarningType, item.EarningType, contr.ContractCD.Trim(), PXErrorLevel.Error)));

Example: we have 2 row invalid, but end process, we have 1 row show error

 

Userlevel 7
Badge +9

I don’t see the loop code. Please provide. From what I see you are setting the error on e.Row which if you are following my suggestion then it is referring to the header not the line

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