2016-07-23 10 views
0

SalesTable.IntercompanyOriginalCustAccountフィールドに直接取引先の住所を得意先の内部取引で照会し​​たいとします。私はその顧客の住所を示す必要がある顧客記録を得ることができます。しかし、顧客の住所を変更すると、次のコードで返される住所は空です。会社間の顧客の郵便番号はどのように表示できますか?

display public LogisticsAddressing getAlamat() 
{ 
    CustTable     custTable; 
    DirPartyTable    dirPartyTable; 
    LogisticsPostalAddress  logisticsPostalAddress; 
    LogisticsAddressing   alamat; 
    CustAccount     intercompanyCust = this.InterCompanyOriginalCustAccount; 

    alamat = ""; 
    changeCompany('ma-d') 
    { 
     while select firstOnly custTable 
       order by logisticsPostalAddress.RecId desc 
       where intercompanyCust == custTable.AccountNum 
      join dirPartyTable 
       where dirPartyTable.RecId == custTable.Party 
      join logisticsPostalAddress 
       where logisticsPostalAddress.location == dirPartyTable.PrimaryAddressLocation 
        //&& logisticsPostalAddress.recVersion == 1 
     { 
      alamat=logisticsPostalAddress.Address; 
     } 
    } 
    return alamat; 
} 

答えて

1

私は、これはあなたの要件を満たしている場合わからないんだけど、テーブルCustTablepostalAddress方法を見てみましょう。これを使用すると、コードは次のようになります。

display public LogisticsAddressing getAlamat() 
{ 
    CustTable     custTable; 
    LogisticsPostalAddress  logisticsPostalAddress; 
    LogisticsAddressing   alamat; 

    changeCompany(this.InterCompanyCompanyId) 
    { 
     custTable = CustTable::find(this.InterCompanyOriginalCustAccount); 
     logisticsPostalAddress = custTable.postalAddress(); 
     alamat = logisticsPostalAddress.Address; 
    } 
    return alamat; 
}