Skip to Content
0
Former Member
Oct 12, 2006 at 09:20 AM

creating a service call using DI API

807 Views

Hi all,

I have written code to connect to businessone.It is connecting.But after that the error is coming....

code written is.....

String c="C40001";

getConnection();

System.out.println("Connected");

IDocuments objServiceCall=SBOCOMUtil.newDocuments(company,SBOCOMConstants.BoObjectTypes_oServiceCalls);

objServiceCall.setCardCode(c);

objServiceCall.setDocDate(new Date());

int i=objServiceCall.add();

String callId=company.getNewObjectKey();

**********************************************************

Error:

com.sap.smb.sbo.wrapper.com.ComFailException: Invoke of: GetBusinessObject

Source: SAPbobsCOM.Company.6.7

Description: You are not connected to a company

at com.sap.smb.sbo.wrapper.com.Dispatch.invokev(Native Method)

at com.sap.smb.sbo.wrapper.com.Dispatch.invokev(Unknown Source)

at com.sap.smb.sbo.wrapper.com.Dispatch.callN(Unknown Source)

at com.sap.smb.sbo.wrapper.com.Dispatch.call(Unknown Source)

at com.sap.smb.sbo.api.Company.getBusinessObject(Unknown Source)

at com.sap.smb.sbo.api.SBOCOMUtil.newDocuments(Unknown Source)

at in.mobileone.www.b1.CreateServiceCall.main(CreateServiceCall.java:35)

Exception in thread "main"

Is it the correct approach or not.

any one guide me in this issue.

Thanks&Regards

Madhu