cancel
Showing results for 
Search instead for 
Did you mean: 

Problem adding CustomerEquipmentCards

Former Member
0 Kudos

Hi all,

I'm connecting with two companys, the active in SBO and other in wich I want to copy a customer equipments card.

The conections are ok and tarjeta and tarjeta2 have the correct dates but whene i execute he add method nothing happens.

Have i call another method? i post the simple code. I dont know why dont run correctly.

Dim tarjeta, tarjeta2 As SAPbobsCOM.CustomerEquipmentCards

tarjeta = pcompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oCustomerEquipmentCards)

tarjeta2 = pcompany2.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oCustomerEquipmentCards)

If tarjeta.GetByKey(14) = True Then

tarjeta2 = tarjeta

tarjeta2.Add()

Else SBO_Application.MessageBoxpcompany2.GetLastErrorDescription())

End If

Regards,

Alfredo Temprano.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Alfredo,

I think you are going to have to set all the individual properties for the customer equipment card, but first you can try to change your add line to read as follows:

if tarjeta2.Add() <> 0 then
     SBO_Application.MessageBox(pcompany2.GetLastErrorDescription())
else
     SBO_Application.MessageBox("Card Added")
end if

Hope it helps,

Adele

Former Member
0 Kudos

Thanks Adele, im going to prove set all individual properties.

It happends with all objects in SBO??? I cant make equal two similar objects?

Regards,

Alfredo Temprano.

Former Member
0 Kudos

I have try passing all de alors of the customer equipments cards and then call the add method like this:

If tarjeta.GetByKey(14) = True Then

tarjeta2.CustomerCode = tarjeta.CustomerCode

tarjeta2.CustomerName = tarjeta.CustomerName

tarjeta2.DeliveryCode = tarjeta.DeliveryCode

tarjeta2.DirectCustomerCode = tarjeta.DirectCustomerCode

tarjeta2.DirectCustomerName = tarjeta.DirectCustomerName

tarjeta2.InternalSerialNum = tarjeta.InternalSerialNum

tarjeta2.InvoiceCode = tarjeta.InvoiceCode

tarjeta2.ItemCode = tarjeta.ItemCode

tarjeta2.ItemDescription = tarjeta.ItemDescription

tarjeta2.ManufacturerSerialNum = tarjeta.ManufacturerSerialNum

tarjeta2.StateCode = tarjeta.StateCode

tarjeta2.StatusOfSerialNumber = tarjeta.StatusOfSerialNumber

tarjeta2.Street = tarjeta.Street

If tarjeta2.Add() <> 0 Then

SBO_Application.MessageBox(pcompany2.GetLastErrorCode())

Else

SBO_Application.MessageBox("Card Added")

End If

Else

SBO_Application.MessageBox(pcompany2.GetLastErrorDescription())

End If

and y found the error -2028 In the help this error is Data Source - No Data Found.

I dont know what is happend. What are i doing wrong?

Thanks,

Alfredo Temprano.

AdKerremans
Active Contributor
0 Kudos

Hi Alfredo,

change your code

If tarjeta2.Add() <> 0 Then

SBO_Application.MessageBox(pcompany2.GetLastErrorCode())

Else

SBO_Application.MessageBox("Card Added")

End If

Else

SBO_Application.MessageBox(pcompany2.GetLastErrorDescription())

End If

to

If tarjeta2.Add() <> 0 Then

SBO_Application.MessageBox(pcompany2.GetLastErrorCode() + "/" + pcompany2.GetLastErrorDescription())

Else

SBO_Application.MessageBox("Card Added")

End If

then you see the errormessage code and text.

Ad

Former Member
0 Kudos

Check if the customer, itemcode in your target database exists.

Former Member
0 Kudos

Thanks all for response,

The description error is in blank. I only can read de number error -2028, thats in help said data source - no dat found.

I have check the customer and de itemcode, and it's ok in both companies.

Should i have another objects equals in both companies? for example description of item...

Regards,

Alfredo Temprano

Former Member
0 Kudos

Hi Alfredo,

What I allways suggest in this cases is to do the same using the GUI, step by step. Usually it is not a development error, but data relation or mismatch error. It is much more easier to detect this errors using the SBO GUI than doing it debbuging.

I know is not much, but hope helps.

Regards,

Ibai Peñ

Former Member
0 Kudos

You can try to create the equipment using the application Business one, not the SDK.

Just enter the exact value, the application may give you a better explanation of the error

The mandatory fields for equipment are Item Code, Customer and (manuf sn or internal sn)

Sebastien

Ibai was faster than me

Message was edited by: Sébastien Danober

Former Member
0 Kudos

I have just try with GUI and run corectly.

Then i have try to do this by code and dont, by I just put the client, item and serial number and delivery code and run ok!

I think than if in one company y have a property in blank and i try to copy to the other company in blank the method add fail.

I am goin to prove one by one and see in wich fail.

Thanks all for your help.

Regards,

Alfredo Temprano

Answers (0)