Axapta 解析参考法

Axapta 解析参考法,axapta,x++,dynamics-ax-2012,Axapta,X++,Dynamics Ax 2012,我是Dynamics AX 2012的新手,在我们的项目中,我们有一个参考组的查找,查找值如下: A C B D C B C A D 你的两张桌子是空的,那不是你想要的 您需要exists联接,返回部门中已存在的作业 这可以通过以下行完成: qbdsPositionDetails.joinMode(JoinMode::ExistsJoin); 这给了我们: public Common lookupReference(FormReferenceControl _formReferenceCont

我是Dynamics AX 2012的新手,在我们的项目中,我们有一个参考组的查找,查找值如下:

A C B D C B C A D 你的两张桌子是空的,那不是你想要的

您需要exists联接,返回部门中已存在的作业

这可以通过以下行完成:

qbdsPositionDetails.joinMode(JoinMode::ExistsJoin);
这给了我们:

public Common lookupReference(FormReferenceControl _formReferenceControl)
{
    SysReferenceTableLookup lookup = SysReferenceTableLookup::newParameters(tableNum(HcmJob),_formReferenceControl, true);
    QueryBuildDataSource ds = lookup.parmQuery().dataSourceNo(1).addDataSource(tableNum(HcmPositionDetail));
    ds.addRange(fieldNum(HcmPositionDetail,Department)).value(queryValue(HCMResRequirement.Department));
    ds.joinMode(JoinMode::ExistsJoin);    
    ds.relations(true);        
    lookup.addLookupField(fieldNum(HcmJob,JobId));
    lookup.addLookupMethod(tableMethodStr(HcmJob,description));
    return lookup.performFormLookup();   
}

你能更具体、更清楚地说明所涉及的确切表格和字段,并指定表格之间的关系吗?也可以使用在标点符号之后而不是之前用空格来清理你的问题。使用额外的换行符来创建段落。@user3049607我想筛选值。这是正确的答案。如何接受答案请参阅:
qbdsPositionDetails.joinMode(JoinMode::ExistsJoin);
public Common lookupReference(FormReferenceControl _formReferenceControl)
{
    SysReferenceTableLookup lookup = SysReferenceTableLookup::newParameters(tableNum(HcmJob),_formReferenceControl, true);
    QueryBuildDataSource ds = lookup.parmQuery().dataSourceNo(1).addDataSource(tableNum(HcmPositionDetail));
    ds.addRange(fieldNum(HcmPositionDetail,Department)).value(queryValue(HCMResRequirement.Department));
    ds.joinMode(JoinMode::ExistsJoin);    
    ds.relations(true);        
    lookup.addLookupField(fieldNum(HcmJob,JobId));
    lookup.addLookupMethod(tableMethodStr(HcmJob,description));
    return lookup.performFormLookup();   
}