conditionally make filed mandatory

Userlevel 4

Hello everyone,
I want make AFE number mandatory only when the approver workgroup is “AFE APPROVAL” 
I have tried to get that value in that field in the specified DAC but I’m getting no response on the UI.

kindly assist.
All responses will be highly appreciated.


Best answer by Giri K 31 May 2023, 08:15

View original

3 replies

Badge +12

Please post the code 😏

Userlevel 4
Badge +1


Write the below code in RowSelected event.

PXDefaultAttribute.SetPersistingCheck<DAC.Field>(pxcache, data, PXPersistingCheck.NullOrBlank).

Make sure that AFE number field contains PXDefault attribute.

Userlevel 7
Badge +19

@development93  Two things..

  1. Your Form should be added with Properly called MarkRequired="Dynamic"
  2. And add the SetRequired and  SetPersistingCheck code in the RowSelected event.

Here is the KB article to make the field mandatory dynamically based on the conditions.


Hope this helps!


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