簡體   English   中英

檢測Dynamics-AX-2012中的字段之間是否存在連接

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM