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

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...