//Enable/Disable form control in Dynamics 365 for finance and operations
-> Create a post event handler method setFieldAccess of a standard form method for enable/disable functionality
Code Sample:
[PostHandlerFor(formStr(SSPropertyTable), formMethodStr(SSPropertyTable, setFieldAccessHeader))]
public static void SSPropertyTable_Post_setFieldAccessHeader(XppPrePostArgs args)
{
FormRun callerForm= args.getThis();
FormDataSource SSPropertyTable_ds;
SSPropertyTable SSPropertyTableSet;
SSPropertyTable_ds= callerForm.dataSource(1);
SSPropertyTableSet= SSPropertyTable_ds.cursor();
callerForm.control(callerForm.controlId(formControlStr(SSPropertyTable, SSPropertyStatus))).enabled((SSPropertyTableSet.Linked) ? true : false);
}
-> Create a post event handler method setFieldAccess of a standard form method for enable/disable functionality
Code Sample:
[PostHandlerFor(formStr(SSPropertyTable), formMethodStr(SSPropertyTable, setFieldAccessHeader))]
public static void SSPropertyTable_Post_setFieldAccessHeader(XppPrePostArgs args)
{
FormRun callerForm= args.getThis();
FormDataSource SSPropertyTable_ds;
SSPropertyTable SSPropertyTableSet;
SSPropertyTable_ds= callerForm.dataSource(1);
SSPropertyTableSet= SSPropertyTable_ds.cursor();
callerForm.control(callerForm.controlId(formControlStr(SSPropertyTable, SSPropertyStatus))).enabled((SSPropertyTableSet.Linked) ? true : false);
}
No comments:
Post a Comment