Tuesday, February 28, 2023

Record from Data source from Form Event Handler X++ | | D365 F&0 | Dynamics 365 Finance

Record from Data source from Form Event Handler X++


[FormEventHandler(formStr(ProjInvoiceProposalDetail), FormEventType::Initialized)]

    public static void ProjInvoiceProposalDetail_OnInitialized(xFormRun sender, FormEventArgs e)

    {

 

        CustTable           custTable;

        ProjProposalJour    projProposalJour = sender.dataSource(formDataSourceStr(ProjInvoiceProposalDetail, ProjProposalJour)).cursor() as ProjProposalJour;

        FormCheckBoxControl isSpecialInvoiceFormat = sender.design().controlName(formControlStr(ProjInvoiceProposalDetail, ProjProposalJour_AD_IsSpecialInvoiceFormat)) as FormCheckBoxControl;       

        if(projProposalJour.OrderAccount)

            custTable = CustTable::find(projProposalJour.OrderAccount);

No comments: