web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

How to set 'Allow Edit' property of the field of a form in event handler. #dynamics #d365 #ax

Krishna Bhardwaj Profile Picture Krishna Bhardwaj 97

Here we have an OnModified event handler of MandatoryPriorToRAF form control( or we can say field). Now I'm going to set 'Allow Edit' property

as false according to my requirement.

[FormControlEventHandler(formControlStr(PdsBatchAttrib, PdsBatchAttrib_MandatoryPriorToRAF), FormControlEventType::Modified)]

public static void PdsBatchAttrib_MandatoryPriorToRAF_OnModified(FormControl sender, FormControlEventArgs e)

{

 PdsBatchAttrib batchAttrib   =   sender.formRun().dataSource(formdatasourcestr(PdsBatchAttrib, PdsBatchAttrib)).cursor() as PdsBatchAttrib;

 if(Condition...)

{

sender.formRun().design().controlName(formControlStr(PdsBatchAttrib, PdsBatchAttrib_MandatoryPriorToRAF)).allowEdit(false);

}

}

Comments

*This post is locked for comments