最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

客制化Dynamics 365 财务和运营 中UIBuilder SSRS RDP Lookup功能 / Custom lookup UIBuilder SSRS RDP Dynamics 365 for finance and operations

网络文摘 alirazazaidi 224浏览 0评论
Hi, Today I have simple code snippet to create a custom lookup in SSRS Reports in Dynamics 365 for finance and operations.
public class MyUIBuilder extends SrsReportDataContractUIBuilder
{

    private DialogField vendordf,dialogbranch;
    
    MyDC     contract;
    public void postBuild()
    {
        super();

        contract = this.dataContractObject();

        // binding dialogs with contract fields

        vendordf = this.bindInfo().getDialogField(this.dataContractObject(),
            methodStr(MyDC, parmHcmPerfPeriodId));
        dialogbranch = this.bindInfo().getDialogField(this.dataContractObject(),
            methodStr(MyDC, parmOMOperatingUnitNumber));

       dialogbranch.registerOverrideMethod(methodStr(FormStringControl,lookup),methodStr(BEHCMReviewUIBuilder,divisionCodeLookup),this);

  
        vendordf.registerOverrideMethod(methodStr(FormStringControl,lookup),methodStr(BEHCMReviewUIBuilder,PerfPeriodIdLookup),this);
       
    }

    public void postRun()
    {
    
    }

 
    private void PerfPeriodIdLookup(FormStringControl divisionCodeLookup)
    {
        Query                   query = new Query();
        QueryBuildDataSource    qbd, qbdPerson;
            QueryBuildDataSource qbds;
        QueryBuildDataSource qbdsJoin;
        SysTableLookup sysTableLookup = sysTableLookup::newParameters(tableNum(HcmPerfPeriod), divisionCodeLookup);
        qbds= query.addDataSource(tableNum(HcmPerfPeriod));
          sysTableLookup.parmQuery(query);
           sysTableLookup.addLookupfield(fieldNum(HcmPerfPeriod, PerfPeriodId), true);
     
        sysTableLookup.parmQuery(query);
        sysTableLookup.parmUseLookupValue(False);
        sysTableLookup.performFormLookup();
    }

    private void divisionCodeLookup(FormStringControl divisionCodeLookup)
    {
        Query          query;
        QueryBuildDataSource  qbds,qbds1;
        SysTableLookup     sysTableLookup;
        DimensionAttribute   dimAttr;
        ;
        sysTableLookup = SysTableLookup::newParameters(tablenum(OMOperatingUnit),divisionCodeLookup);
        sysTableLookup.addLookupfield(fieldnum(OMOperatingUnit, OmoperatingunitNumber));
        sysTableLookup.addLookupfield(fieldNum(OMOperatingUnit,Name));
        query = new Query();
        qbds = query.addDataSource(tableNum(OMOperatingUnit));
        qbds.addRange(fieldNum(OMOperatingUnit, OMOperatingUnitType)).value(queryvalue(OMOperatingUnitType::OMDepartment));
        sysTableLookup.parmQuery(query);
        sysTableLookup.parmUseLookupValue(False);
        sysTableLookup.performFormLookup();
    }

}
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址