Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Override TAXCLASS1 & TAXCLAS2 in AP Batch 1

Status
Not open for further replies.

Adam007

Programmer
Oct 18, 2009
21
Hey Guys,

I am trying to set the TAXCLASS1 & TAXCLASS2 fields while creating an AP Batch from C#.

Code Sample:
Code:
tempObj = header.TAXCLASS1;
APINVOICE1header.Fields.get_FieldByName("TAXCLASS1").set_Value(ref tempObj);

tempObj = header.TAXCLASS2;
APINVOICE1header.Fields.get_FieldByName("TAXCLASS2").set_Value(ref tempObj);

header.TAXCLASS1 & header.TAXCLASS2 are both 2, but when i actually open the AP Batch in Accpac the TAXCLASS1 is set to 1.

Any ideas would be appreciated.
 
Hey Ettienne,

I did record a macro in Accpac and all it did was set TAXCLASS1 and TAXCLASS2 to '2'. Which is what my code IS doing.

any other ideas?
 
Check that you are not setting the tax group after you change the tax class, because that will set the tax class back to 1.
 
Hey Ettiene,

Well it wasn't the Tax Group, but some other field.
Im not entirely sure if it was because i was setting a field after that was messing it up or if it was the detail lines i was adding after i set the TAXCLASS but i moved it to right before the Insert call and it's working now.

Thx for your help and input.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top