ビジネスアカウントDACを新しいUsrAccountTypeフィールドで拡張しました。そのフィールドがビジネスアカウント更新グラフで更新されるときには、関連する顧客レコードのさまざまなフィールドも更新する必要があります。しかし、「エラー#91:他のプロセスがBAccountレコードを更新しました。変更が失われます。」発生する。顧客をBAccountMaint拡張から更新します(エラー#91別のプロセスが更新されました..)
私は、CustomerクラスのサブセットであるAccount Typeと同じ値にCustomer.customerClassIDフィールドを設定しようとしています。&カスタマークラスの変更に関連する他のフィールドへの変更は適用する必要はありません。
public class BusinessAccountMaint_Extension : PXGraphExtension<BusinessAccountMaint>
{
public PXSelect<Customer, Where<Customer.bAccountID, Equal<Current<BAccount.bAccountID>>>> ARCustomer;
public virtual void BAccount_UsrAccountType_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
{
BAccount row = (BAccount)e.Row;
if (row == null) return;
BAccount_Extension rowExt = row.GetExtension<BAccount_Extension>();
Customer customer = ARCustomer.Current;
if (customer == null) return;
customer.CustomerClassID = rowExt.UsrAccountType;
// additional changes to Customer record
this.Base.Caches<Customer>().Update(customer);
}
}
BAccountと同時に顧客を更新するにはどうすればよいですか? CustomerMaintグラフを作成し、それを使ってレコードを更新する必要がありますか?両方のレコードを同時に更新しても同じ問題は発生しませんか?あるいは、BAccountの変更が永続化され、顧客への変更がそこで行われた後、BAccount_RowPersistedで何かを行うことができますか?