Tuesday, February 28, 2023

Multi-select record from a datasource under the clicked method in a form button code | X++ | D365 F&O | Dynamics 365 Finance and Operation

 Multi-select record from a datasource under the clicked method in a form button code x++


[FormControlEventHandler(formControlStr(EInvoiceCFDIJournal_PJ, AD_EInvoiceCFDIProjControllerOriginal_MX), FormControlEventType::Clicked)]

    public static void AD_EInvoiceCFDIProjControllerOriginal_MX_OnClicked(FormControl sender, FormControlEventArgs e)

    {

        Args args = new Args();

        ProjInvoiceJour         projInvoiceJour;

        FormDataSource projInvoiceJour_ds;

 

        projInvoiceJour_ds = sender.formRun().dataSource(formDataSourceStr(EInvoiceCFDIJournal_PJ, ProjInvoiceJour)) as FormDataSource;

        projInvoiceJour = projInvoiceJour_ds.getFirst(1);

        //     projInvoiceJour = projInvoiceJour_ds.cursor();

 

        while (projInvoiceJour.RecId != 0)

        {

        info(projInvoiceJour.ProjInvoiceId);

 

        projInvoiceJour = projInvoiceJour_ds.getNext();

        }

    }


No comments: