Tuesday, November 27, 2018

Form - Chain Of Command D365 FO PU20


Chain of Command on FORMS

1. Method on DataSource extension
            [ExtensionOf(FormDatasourceStr(<FormName>,<DataSourceName>))]
2. Method on DataSource field extension
            [ExtensionOf(FormDataFieldStr(<FormName>,<DataSourceName>,<DataSourceFieldName>))]
3. Method on Form Control extension
            [ExtensionOf(FormControlStr(<FormName>,<controlName>))]
4. Method on Form extension
            [ExtensionOf(FormMethodStr(<FormName>,<cMethodName>))]


Samples:

FORM on Extension

DataSource Method

FormDataSource fds = this;
<Table buffer> = fds.cursor();

DataSourceField

FormDataSource fds;
FormDataObject fdo = any2Object(this) as FormDataObject;
fds = fdo.Datasource();
<Table buffer> = fds.cursor();

FormControl

FormDataSource fds;
FormButtonControl fbc = this as FormButtonControl;
fds = fbc.formRun().Datasource(tableStr(<Table Name of DS>));
<Table buffer> = fds.cursor();


Sample:
 FormDateTimeControl     dtc1 = any2object(this) as formDateTimeControl;
        FormRun                 fr              = dtc1.formRun() as FormRun;
        FormDateTimeControl     dtc2   = fr.design().controlName(formControlStr(<formname>, <controlname>) as formDateTimeControl;

No comments:

Post a Comment

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...