D365F&O - X++ - Get datasources in datasource extension on form

[ExtensionOf(formdatasourcestr(VendPaymMode,CustomTable))]
final class MJ_VendPaymMode_MJVendPaymModeTable_Extension
{
    public void write()
    {
        //Get the datasource for which we are writing extension on form
        CustomTable customTable = this.cursor();

        //Get another datasource on form
        VendPaymModeTable VendPaymModeTable = this.formRun().dataSource(
                formdatasourcestr(VendPaymMode, VendPaymModeTable)).cursor();

        customTable.VendPaymModeRecId = VendPaymModeTable.RecId;

        next write();
    }
}

Comments

Popular posts from this blog

D365F&O - X++ - Best Practice Warning BP Rule: [BPErrorUnknownLabel]: Path:

D365F&O - X++ - How to Enable/Disable button on form based on a condition in D365F&O using Event handlers.

D365FO - X++ - Generate CAR (Customized Analysis Report) report of custom model