Skip to main content
Solved

conditionally make filed mandatory


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.

Please post the code 😏


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


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


Reply