Skip to main content
Question

Show error field in multi row


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+10
  • Captain II
  • 1203 replies
  • June 19, 2023

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.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • June 19, 2023

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

 


Forum|alt.badge.img
  • Author
  • Freshman II
  • 35 replies
  • June 19, 2023

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

 


aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • 1203 replies
  • June 19, 2023

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings