on 05-04-2006 8:49 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
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
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ñ
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
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
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.