VendSettlementTax1099 Table updateIRSReportable Method Probles

Hello

When the user want to Reverse the Cheque in Dynamics ax 2009. Then a critical error happened. Then error in VendSettlementTax1099 Table updateIRSReportable method. we have no change code in this method. All the codes are Standard Ax codes in this table. From My observation I can understand that we a new record is insert VendSettlementTax1099 Table, then it fires the Insert Method of this table. The Insert method fires the updateIRSReportable to update IRSReportable Flag of this table. Then It fires the Update method of this tables. And the update method fires the updateIRSReportable.

Then a continuous loop is created between Update Method & updateIRSReportable method. Please give me suggestion how can i solve this Problem.

Thanks.

What exactly the error you are getting?

Try to debug and find the line of code that is resulting the issue.

I have debug the code. Actually the Error is happened in the following Methods

public void updateIRSReportable()

{

VendSettlementTax1099 localVendSettlementTax1099;

Tax1099Amount minAmount = Tax1099Fields::find(this.Tax1099Box).Tax1099Amount;

;

select sum(SettleTax1099Amount)

from localVendSettlementTax1099

where ((localVendSettlementTax1099.VendAccount == this.VendAccount) &&

(localVendSettlementTax1099.Tax1099Box == this.Tax1099Box));

localVendSettlementTax1099.skipDatabaseLog(true);

localVendSettlementTax1099.skipDataMethods(true);

ttsbegin;

if (localVendSettlementTax1099.SettleTax1099Amount >= minAmount)

{

localVendSettlementTax1099.clear();

update_recordset localVendSettlementTax1099 setting

IRSReportable = NoYes::Yes

where ((localVendSettlementTax1099.VendAccount == this.VendAccount) &&

(localVendSettlementTax1099.Tax1099Box == this.Tax1099Box));

}

else

{

localVendSettlementTax1099.clear();

update_recordset localVendSettlementTax1099 setting

IRSReportable = NoYes::No

where ((localVendSettlementTax1099.VendAccount == this.VendAccount) &&

(localVendSettlementTax1099.Tax1099Box == this.Tax1099Box));

}

ttscommit;

localVendSettlementTax1099.skipDatabaseLog(false);

localVendSettlementTax1099.skipDataMethods(false);

}

In this method when a field is updated then it fires the update method of this table. And the Update method fire the updateIRSReportable method. Thus a continuous loop is created. The program can not terminate from this continous loop.

Actually the updateIRSReportable method update IRSReportable flag of this table. If no update happen then it does not fire the update method. I have seen that all the IRSReportable flag are true before running this method from database. After debug the code it also set IRSReportable flag true. Actually No update happen. So why it fire the update method.

I have also observed that the method work fine for Update 1099 Tax under Vendor form >> Function>> Update 1099 Tax

But It does not work for Bank>> Checks>> Payment Reversal.

Please advised me how can I solve this Problem.

I have debug the code. Actually the Error is happened in the following Methods

public void updateIRSReportable()

{

VendSettlementTax1099 localVendSettlementTax1099;

Tax1099Amount minAmount = Tax1099Fields::find(this.Tax1099Box).Tax1099Amount;

;

select sum(SettleTax1099Amount)

from localVendSettlementTax1099

where ((localVendSettlementTax1099.VendAccount == this.VendAccount) &&

(localVendSettlementTax1099.Tax1099Box == this.Tax1099Box));

localVendSettlementTax1099.skipDatabaseLog(true);

localVendSettlementTax1099.skipDataMethods(true);

ttsbegin;

if (localVendSettlementTax1099.SettleTax1099Amount >= minAmount)

{

localVendSettlementTax1099.clear();

update_recordset localVendSettlementTax1099 setting

IRSReportable = NoYes::Yes

where ((localVendSettlementTax1099.VendAccount == this.VendAccount) &&

(localVendSettlementTax1099.Tax1099Box == this.Tax1099Box));

}

else

{

localVendSettlementTax1099.clear();

update_recordset localVendSettlementTax1099 setting

IRSReportable = NoYes::No

where ((localVendSettlementTax1099.VendAccount == this.VendAccount) &&

(localVendSettlementTax1099.Tax1099Box == this.Tax1099Box));

}

ttscommit;

localVendSettlementTax1099.skipDatabaseLog(false);

localVendSettlementTax1099.skipDataMethods(false);

}

In this method when a field is updated then it fires the update method of this table. And the Update method fire the updateIRSReportable method. Thus a continuous loop is created. The program can not terminate from this continous loop.

Actually the updateIRSReportable method update IRSReportable flag of this table. If no update happen then it does not fire the update method. I have seen that all the IRSReportable flag are true before running this method from database. After debug the code it also set IRSReportable flag true. Actually No update happen. So why it fire the update method.

I have also observed that the method work fine for Update 1099 Tax under Vendor form >> Function>> Update 1099 Tax

But It does not work for Bank>> Checks>> Payment Reversal.

Please advised me how can I solve this Problem.