22 July 2022

Form multi select lookup using control in D365FO

 /// <summary>

/// 

/// </summary>

class TRGReqTransPOEventHandler

{

    

    /// <summary>

    ///

    /// </summary>

    /// <param name="sender"></param>

    /// <param name="e"></param>

    [FormControlEventHandler(formControlStr(ReqTransPo, TRGSalesId), FormControlEventType::Lookup)]

    public static void TRGSalesId_OnLookup(FormControl sender, FormControlEventArgs e)

    {

        Query                query = new Query();

        QueryBuildDataSource queryBuildDataSource;

        QueryBuildRange      queryBuildRangeOrderAcc, queryBuildRangeStatus;

        FormDataSource       formDataSource;

        SalesTable           salesTable;

        container            selectFieldPurchRef = [tableNum(SalesTable), fieldNum(SalesTable, SalesId)];


        queryBuildDataSource = query.addDataSource(tableNum(SalesTable));

        queryBuildDataSource.addSelectionField(fieldNum(SalesTable, SalesId));

        queryBuildDataSource.fields().dynamic(NoYes::No);

        queryBuildDataSource.fields().clearFieldList();

        queryBuildDataSource.fields().addField(fieldNum(SalesTable, SalesId));

        SysLookupMultiSelectCtrl::constructWithQuery(fr,sender,query,false,selectFieldPurchRef);

    }

}

1 comment:

  1. This is half code you have to provide modified method also

    ReplyDelete

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...