Wednesday, July 28, 2021

Lookup On Form Extension using Event Handler

Check the Event handler Code,

    [FormControlEventHandler(formControlStr(BankParameters, JournalName_VendPaymJourName), FormControlEventType::Lookup)]

    public static void JournalName_VendPaymJourName_OnLookup(FormControl sender, FormControlEventArgs e)

    {

        Query                   query = new Query();

        QueryBuildDataSource    queryBuildDataSource;

        QueryBuildRange         queryBuildRange;

        SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(LedgerJournalName), sender);

        sysTableLookup.addLookupField(fieldNum(LedgerJournalName, JournalName));

        sysTableLookup.addLookupField(fieldNum(LedgerJournalName, Name));

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

        sysTableLookup.parmQuery(query);

        sysTableLookup.performFormLookup();

    }

Enjoy .👍

Workflow Approver Name For PurchRequsition Order

 For First Approver, this.workflowApprover(purchReqTable.RecId);     public void workflowApprover (RecId _recId)  // Requsation Table RecId ...