Skip to main content
Question

Show error field in multi row

  • Jun 19, 2023 2:55 AM UTC
  • 4 replies
  • 224 views
  • Translate All

Forum|alt.badge.img

 

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

aaghaei
Captain II
Forum|alt.badge.img+11
  • Captain II
  • Jun 19, 2023 3:52 AM UTC

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.

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Jun 19, 2023 4:38 AM UTC

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

 

Translate

Forum|alt.badge.img
  • Author
  • Freshman II
  • Jun 19, 2023 6:31 AM UTC

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

 

Translate

aaghaei
Captain II
Forum|alt.badge.img+11
  • Captain II
  • Jun 19, 2023 6:53 AM UTC

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

Translate