[英]Detect whether the connection exists between fields in Dynamics-AX-2012
我有两个表,table1(字段:playerId,insuranceId)和table2。
如何从表2中确定playerId和insuranceId是否相互连接?
我的意思是哪个球员与哪个保险公司达成协议...
我知道我应该重写表中的方法(哪个?)并使用table1存在的方法来使其工作,但我不知道该怎么做。
我不确定我是否正确理解您,但是您在table2上创建了下一个方法
public boolean existInTable1()
{
table1 t;
;
select recid from t where t.playerid == this.playerid && t.insuranceid == this.insuranceid;
return (t.recid !== 0);
}
在代码中的某处:
table2 t2;
;
select t2;
if(t2.existInTable1()) ...
更新
当然,如果在table1上存在存在方法,则可以像下面这样重写existInTable1():
public boolean existInTable1()
{
;
return table1::exist(this.playerid, this.insuranceid);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.