【发布时间】:2015-03-06 08:01:48
【问题描述】:
类可以接收 VendTable、CustTable 或 smmOpportunityTable 记录。
例如,通常会收到一条 CustTable 记录,而一个新的需求使 smmOpportunityTable 发挥作用,所以我使用公共记录通过这段代码来捕获它:
(在设置 custTable 记录的代码中前面发生了一些其他事情)。
commonParty = custTable.RecId != 0 ? custTable : smmOpportunityTable;
问题是,上面这行代码给出了一个编译警告“Operand types are not compatible with the operator.”; smmOpportunityTable 出错。
我的问题,为什么我不能将 smmOpportunityTable 的实例设置为 common?当然它的基本类型很常见吗?任何想法如何解决警告?
我正在使用 Dynamics Ax 2012 R1 进行开发。
【问题讨论】: