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

自定义D365财务和运营的查找字段和组参考字段 / Custom lookup field and group reference field D365 for finance and operations

网络文摘 alirazazaidi 227浏览 0评论
Hi all following code snippet for custom lookup. Copy the onlookup event handler and copy in extension class and the following code snippet   Field based
[FormControlEventHandler(formControlStr(Txxxx, Txxxx_ChildName), FormControlEventType::Lookup)] public static void xxxxx_DssChildName_OnLookup(FormControl sender, FormControlEventArgs e) { Query query = new Query(); QueryBuildDataSource qbds; QueryBuildDataSource qbdsJoin; SysTableLookup sysTableLookup = sysTableLookup::newParameters(tableNum(DirPartyTable), sender); qbds= query.addDataSource(tableNum(DirPartyTable)); qbdsJoin= qbds.addDataSource(tableNum(DirPartyRelationship)); //qbdsJoin.relations( false); //qbdsJoin.fields().dynamic(NoYes::Yes); // hcmWorkerCaller = HcmWorker::find(currentWorker()); // qbds.addRange(fieldNum(DirPartyTable, RecId)).value(int642Str(HcmWorker::find(currentWorker()).Person)); qbdsJoin.addRange(fieldNum(DirPartyRelationship, parentparty)).value(int642Str(HcmWorker::find(currentWorker()).Person)); qbdsJoin.addLink(fieldNum(DirPartyTable, RecId), fieldNum(DirPartyRelationship, childparty)); qbdsJoin.joinMode(JoinMode::InnerJoin); sysTableLookup.parmQuery(query); sysTableLookup.addLookupfield(fieldNum(DirPartyTable, Name), true); sysTableLookup.addLookupfield(fieldNum(DirPartyTable, RecId)); sysTableLookup.performFormLookup(); FormControlCancelableSuperEventArgs event = e as FormControlCancelableSuperEventArgs; event.CancelSuperCall(); }
Reference based is as follow
[FormControlEventHandler(formControlStr(xxxxx, Txeee_dddd), FormControlEventType::Lookup)] public static void ddddee_DSSPerson_OnLookup(FormControl sender, FormControlEventArgs e) { Query query = new Query(); QueryBuildDataSource qbds; QueryBuildDataSource qbdsJoin; SysReferenceTableLookup _sysTableLookup = SysReferenceTableLookup::newParameters(tableNum(DirPartyTable), sender); qbds= query.addDataSource(tableNum(DirPartyTable)); qbdsJoin= qbds.addDataSource(tableNum(DirPartyRelationship)); //qbdsJoin.relations( false); //qbdsJoin.fields().dynamic(NoYes::Yes); // hcmWorkerCaller = HcmWorker::find(currentWorker()); // qbds.addRange(fieldNum(DirPartyTable, RecId)).value(int642Str(HcmWorker::find(currentWorker()).Person)); qbdsJoin.addRange(fieldNum(DirPartyRelationship, parentparty)).value(int642Str(HcmWorker::find(currentWorker()).Person)); qbdsJoin.addLink(fieldNum(DirPartyTable, RecId), fieldNum(DirPartyRelationship, childparty)); qbdsJoin.joinMode(JoinMode::InnerJoin); _sysTableLookup.parmQuery(query); _sysTableLookup.addLookupfield(fieldNum(DirPartyTable, Recid)); _sysTableLookup.addLookupfield(fieldNum(DirPartyTable, Name)); //, true); // _sysTableLookup.addLookupfield(fieldNum(DirPartyTable, recid)); _sysTableLookup.performFormLookup(); FormControlCancelableSuperEventArgs event = e as FormControlCancelableSuperEventArgs; event.CancelSuperCall(); }
 
发表我的评论
取消评论

表情

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

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