Skip to Content
0
Former Member
Jul 21, 2017 at 01:28 PM

Deposit (object type 25) with Business Partner

119 Views

Hi

When I try to add a deposit where the AccountType is a business partner an error is displayed telling you to specify a branch that is not disabled in JDT1.

SAPbobsCOM.CompanyService companyService = oCompany.GetCompanyService();
SAPbobsCOM.DepositsService dpService = (SAPbobsCOM.DepositsService)companyService.GetBusinessService(SAPbobsCOM.ServiceTypes.DepositsService);
SAPbobsCOM.Deposit dpsAddCreditCard = dpService.GetDataInterface(SAPbobsCOM.DepositsServiceDataInterfaces.dsDeposit);
SAPbobsCOM.DepositParams dpParams;
SAPbobsCOM.CreditLines odepositLines = dpsAddCreditCard.Credits;
SAPbobsCOM.CreditLine odepositLine;

dpsAddCreditCard.BPLID = 1; //(Is active)

dpsAddCreditCard.DepositDate = DateTime.Now;
dpsAddCreditCard.DepositType = SAPbobsCOM.BoDepositTypeEnum.dtCredit;
dpsAddCreditCard.ReconcileAfterDeposit = SAPbobsCOM.BoYesNoEnum.tNO;

//Test BankAccount
//dpsAddCreditCard.DepositAccountType = SAPbobsCOM.BoDepositAccountTypeEnum.datBankAccount;
//dpsAddCreditCard.DepositAccount = _BanckAcct;
//dpsAddCreditCard.VoucherAccount = _BanckAcct;

//Test Business Partner
dpsAddCreditCard.DepositAccountType = SAPbobsCOM.BoDepositAccountTypeEnum.datBusinessPartner;
dpsAddCreditCard.DepositAccount = _CardCode; 

odepositLine = odepositLines.Add();
odepositLine.AbsId = 999;

dpParams = dpService.AddDeposit(dpsAddCreditCard);