AR Write Off and Adjustment Posting

I am attempting to create a customization for AR Write Off and Adjustments such that a selected number of invoices can be processed at the same time vs individually. Below is the code written to create the Adjustment and set the required fields. The code follows the trace methods with the exception of the Update method at the end. Use of the standard form requires the user to Submit the Process to the Task Agent for posting. Referencing the Help file, it states:

  • A posting action is not necessary when adjusting or writing off an invoice; the GL updates once the adjustment saves

However, this may be outdated as the following error is received when running the code:


I have ran traces for both processes of using the standard form and running the code. The mehtod calls, datasets and responses are identical. The code completes sucessfully through the ValidateTransaction method, but fails during the Update method.

Lastly, I noticed the Erp.Contracts.Proc.ARInvAdjPost assembly was included when adding the reference to the ARAdjustment Adapter. I need an education on how to reference that assembly in the customization to gain access to its methods. Any suggestions, direction would be greatly appreciated.


private void WriteOffInvoice(int invoiceNum, double adjustAmt)
		string glCompany = "*****";
		string glChart = "*****";
		string glAccount = "*****";
		string glSegValue1 = "*****";
		string glSegValue2 = "*****";
		string glSegValue3 = "*****";
		string glSegValue4 = "*****";
		string adjComment = this.txtComment.Value.ToString();
		bool reload = false;
		using (ARAdjustmentAdapter AdjustmentAdapter = new ARAdjustmentAdapter(this.oTrans))
			DataRow cashDtlRow = AdjustmentAdapter.ARAdjustmentData.Tables["CashDtl"].Rows[0];
				cashDtlRow["DocDispTranAmt"] = adjustAmt;
				cashDtlRow["DispTranAmt"] = adjustAmt;
				cashDtlRow["Reference"] = adjComment;
			AdjustmentAdapter.ChangeAdjAmount(out reload);
			DataRow cashDtlTGLCRow = AdjustmentAdapter.ARAdjustmentData.Tables["CashDtlTGLC"].Rows[0];
				cashDtlTGLCRow["GLAccount"] = glAccount;
				cashDtlTGLCRow["SegValue1"] = glSegValue1;
				cashDtlTGLCRow["SegValue2"] = glSegValue2;
				cashDtlTGLCRow["SegValue3"] = glSegValue3;
				cashDtlTGLCRow["SegValue4"] = glSegValue4;
			AdjustmentAdapter.ChangeGLAcctDisp(glCompany, glChart, glAccount);
	catch (System.Exception ex)