0
我正在使用的網格有一個聯繫人的選擇器,在輸入上我試圖檢查我的自定義日期字段的相關聯繫人公司帳戶。從聯繫人獲取關聯帳戶?
protected void atcProjectDistributionTable_RowUpdated(PXCache cache, PXRowUpdatedEventArgs e, PXRowUpdated InvokeBaseHandler)
{
if (InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
var row = (atcProjectDistributionTable)e.Row;
if (row.ContactID != null)
{
Contact con = PXSelectorAttribute.Select<atcProjectDistributionTable.contactID>(cache, row) as Contact;
row.ContactCD = con.FullName;
row.BAcc = con.BAccountID;
if (row.BAcc != null)
{
BAccount bAcc = PXSelectorAttribute.Select<atcProjectDistributionTable.bAcc>(cache, row) as BAccount;
PX.Objects.CR.BAccountExt ba = bAcc.GetExtension<PX.Objects.CR.BAccountExt>();
if (ba.UsrExpiring != null)
{
PXUIFieldAttribute.SetError<atcProjectDistributionTable.bAcc>(cache, row, "Termination date:" + ba.UsrExpiring + " Reason:" + ba.UsrExReason);
}
}
}
}
您正在成功檢索聯繫人公司帳戶。問題是BAccount不包含擴展名BAccountExt。您應該考慮爲什麼DAC擴展不適用於BAccount DAC。 –
謝謝,我不明白爲什麼,相同的代碼在供應商屏幕上工作BAccount bAcc = Base.BAccount.Current; PX.Objects.CR.BAccountExt ba = bAcc.GetExtension(); –
nickivey
請向我們展示您的帳戶ext代碼 –