Solved

conditionally make filed mandatory

  • 29 May 2023
  • 3 replies
  • 115 views

Userlevel 4
Badge

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.

icon

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

View original

3 replies

Badge +11

Please post the code 😏

Userlevel 4
Badge +1

@development93

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 +17

@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.

https://asiablog.acumatica.com/2016/05/dynamically-changing-attribute-property.html

https://stackoverflow.com/questions/58012786/pxpersistingcheck-nullorblank-set-at-run-time

 

Hope this helps!

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