cancel
Showing results for 
Search instead for 
Did you mean: 

creating a service call using DI API

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Gianluigi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Well it sounds pretty self explanatory. Did you connect

successfully to a company before your code ? all the

object operations (add / update / delete / etc) need

to happen in the context of a connected company.

Have a look at the e-learning section here on SDN about

DI API.

Former Member
0 Kudos

Hi Gianluigi,

What you said is correct.At that time my system has some problem with businessone.Now the company object is creating.But the error is showing at

the line of code....

objServiceCall.setCardCode("C40001");

no mapping found for cardcode...

Is the above send code is correct? or there is another way to approach to create a service call through DI API.

Thanks

Madhu

Former Member
0 Kudos

Madhu,

I don't think there's another way using DI, but you could auto fill the form information using UI, and auto-clicking the Add button.

That's another way, a bit different, but human intervention is required to invoke the process.

-

-


Alfredo Pérez

www.corponet.com.mx

SAP Developer & Consultant

alperal (at) gmail.com