cancel
Showing results for 
Search instead for 
Did you mean: 

Error While Updating BP Withholding Tax Codes

dinesh_s1
Participant
0 Kudos
426

While updating BP Withholding Tax through di api I've encountered error deleting rows not supported for object allowed tax codes for bp di api. Do you have any solution on this?

Thanks.

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi dinesh.s1,

Kindly help to share your code.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

dinesh_s1
Participant
0 Kudos

for (int t = 0, loopTo = oBp.BPWithholdingTax.Count - 1; t <= loopTo; t++)

{

oBp.BPWithholdingTax.SetCurrentLine(t);

oBp.BPWithholdingTax.WTCode = WTAX;

oBp.BPWithholdingTax.Add();

}

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi dinesh.s1,

This doesn't appear the complete code.

It doesn't mention whether the Update method is being called or Delete.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

dinesh_s1
Participant
0 Kudos

sorry...Please find the Below Code...This code works fine without adding new Watx code for BP...But i need to assign new Wtax code and Update the BP.

SAPbobsCOM.BusinessPartners oBp = Global.oCompany.GetBusinessObject(BoObjectTypes.oBusinessPartners);

string CardCode = Root.Instance.frmBPMaster.Items.Item("t_code").Specific.Value;

oBp.GetByKey(CardCode);

for (int t = 0, loopTo = oBp.BPWithholdingTax.Count - 1; t <= loopTo; t++)

{

oBp.BPWithholdingTax.SetCurrentLine(t);

oBp.BPWithholdingTax.WTCode = values[t].Trim();

}

if (oBp.Update() != 0)

{

Global.oApplication.SetStatusBarMessage("Business Partner Update Failed: " + Global.oCompany.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, false);

return false;

}

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi dinesh.s1,

Refer to the following post for the solution:

SAP B1 - Service Layer "Deleting rows not supported for object Allowed WTax Codes for BP"

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

dinesh_s1
Participant
0 Kudos

Thanks for the solution...Works Fine.

Answers (0)