Kind a code template to accelerate our job:
[FormDataSourceEventHandler(formDataSourceStr(<FormName>, <FormDataSourceName>), FormDataSourceEventType::Activated)] public static void FormDataSourceName_OnActivated(FormDataSource _sender, FormDataSourceEventArgs _e) { <FormDataSourceTable> formDataSourceTable = _sender.cursor(); FormRun formRun = _sender.formRun(); FormDataSource anyFormDataSource_ds = formRun.dataSource(formDataSourceStr(<FormName>, <AnyFormDataSourceName>)) as FormDataSource; <AnyFormDataSourceTable> anyFormDataSourceTable = anyFormDataSource_ds.cursor(); FormControl anyFormControl = formRun.design(0).controlName('AnyFormControlName');
// your logic goes here, for example
if(formDataSourceTable.enabled()) { anyFormControl.visible(false); anyFormControl.enabled(!anyFormDataSourceTable.RecId); } }
No comments:
Post a Comment