Skip to Content
0
Former Member
Apr 05, 2011 at 03:39 AM

Creating a new (Customer) Business Partner

427 Views

Hello,

I am trying to add a new (Customer) Business Partner, however, "Invalid Control Account Type" error occurs. Is there something I'm missing out or do I have to configure something first before this could work.

The following is my script, hope anyone can help.

Thanks

SAPbobsCOM.BusinessPartners _oBusinessPartners = (SAPbobsCOM.BusinessPartners)OrderApp.oCompany.GetBusinessObject(BoObjectTypes.oBusinessPartners);

_oBusinessPartners.CardCode = pCustomerID;

_oBusinessPartners.CardName = pCustomerName;

_oBusinessPartners.CardType = BoCardTypes.cCustomer;

_oBusinessPartners.CompanyPrivate = BoCardCompanyTypes.cPrivate;

_oBusinessPartners.GroupCode = 100; //Customers Group Code

_oBusinessPartners.AccountRecivablePayables.SetCurrentLine(0);

oBusinessPartners.AccountRecivablePayables.AccountType = BoBpAccountTypes.bpatReceivable;

_oBusinessPartners.AccountRecivablePayables.AccountCode = "140000";

_errNum = _oBusinessPartners.Add();