Axapta 在Dynamics AX 2012中获得客户或潜在客户
我正在尝试使用X++获取客户或潜在客户,并将其用于查找。Axapta 在Dynamics AX 2012中获得客户或潜在客户,axapta,x++,dynamics-ax-2012,Axapta,X++,Dynamics Ax 2012,我正在尝试使用X++获取客户或潜在客户,并将其用于查找。 DirPartyTable中有一个方法返回我想要的内容 DirPartyTable::isCustomerOrRelation while select * from dirPartyTable { if(DirPartyTable::isCustomerOrRelation(dirPartyTable.RecId)) { //Get the Name
DirPartyTable
中有一个方法返回我想要的内容
DirPartyTable::isCustomerOrRelation
while select * from dirPartyTable
{
if(DirPartyTable::isCustomerOrRelation(dirPartyTable.RecId))
{
//Get the Name
//info(dirPartyTable.Name);
}
}
但是,当我构建查询到查找时,我试图以某种方式在查询的addRange
上传递DirPartyTable::iscustomerrelation(DirPartyTable.RecId)
。
有什么方法可以做到这一点还是不可能的?如果您转到
iscustomerrelation
(和isCustomer
和isRelation
)的来源,您会看到,如果当前公司中存在客户或潜在客户,该方法将返回true
您的while select
虽然正确,但效率低下,因为它可能需要扫描一百万个参与方才能选择当前公司中的一千个客户或潜在客户
在select时,一个更有效但语法非法的方法是:
while select * from dirPartyTable
exists join custTable
where custTable.Party == dirPartyTable.RecId
union
select * from dirPartyTable
exists join smmBusRelTable
where smmBusRelTable.Party == dirPartyTable.RecId;
{
info(dirPartyTable.Name);
}
虽然在X++中是非法的,但可以使用查询和视图
进行两次查询(自己翻译成适当的属性):
问题1:
select * from dirPartyTable
exists join custTable
where custTable.Party == dirPartyTable.RecId
问题2:
select * from dirPartyTable
exists join smmBusRelTable
where smmBusRelTable.Party == dirPartyTable.RecId;
根据查询生成两个视图(视图1和视图2)
进行联合查询(查询3),请参见如何,记住指定联合类型
(union
或uninall
)
基于查询3创建视图,请参见如何
结果,使用X++选择所有记录:
while select * from dirPartyCustOrRelationTable
{
info(dirPartyCustOrRelationTable.Name);
}
或者您可以直接使用查询3来检索记录。如果您转到iscustomerrelation
(以及isCustomer
和isRelation
)的源,则如果当前公司中存在客户或潜在客户,则该方法返回true
您的while select
虽然正确,但效率低下,因为它可能需要扫描一百万个参与方才能选择当前公司中的一千个客户或潜在客户
在select
时,一个更有效但语法非法的方法是:
while select * from dirPartyTable
exists join custTable
where custTable.Party == dirPartyTable.RecId
union
select * from dirPartyTable
exists join smmBusRelTable
where smmBusRelTable.Party == dirPartyTable.RecId;
{
info(dirPartyTable.Name);
}
虽然在X++中是非法的,但可以使用查询和视图
进行两次查询(自己翻译成适当的属性):
问题1:
select * from dirPartyTable
exists join custTable
where custTable.Party == dirPartyTable.RecId
问题2:
select * from dirPartyTable
exists join smmBusRelTable
where smmBusRelTable.Party == dirPartyTable.RecId;
根据查询生成两个视图(视图1和视图2)
进行联合查询(查询3),请参见如何,记住指定联合类型
(union
或uninall
)
基于查询3创建视图,请参见如何
结果,使用X++选择所有记录:
while select * from dirPartyCustOrRelationTable
{
info(dirPartyCustOrRelationTable.Name);
}
或者您可以直接使用查询3来检索记录。。我决不会这样想回答得很好。我决不会这样想