on 10-12-2020 3:57 PM
Hi all,
Actually I use below code in php which is fine
$oOrder=$mycomp->GetBusinessObject(22);
But now I want to connect to user defined object called OALW, I tried to replace 22 with OALW like below
$oOrder=$mycomp->GetBusinessObject("OALW");
but I'm getting the following error message Fatal error: Uncaught com_exception: Parameter 0: Type mismatch. in C:\xampp\htdocs\sap\allowance.php:23 Stack trace: #0 C:\xampp\htdocs\sap\allowance.php(23): com->GetBusinessObject('OALW')
How can I use user defined object in GetBusinessObject() in order to update its table?
Hi,
to work with UDO, you should user GeneralService object and GeneralData.
I don't have any php sample, but you can use the following visual basic sample for inspiration :
It cames from SAP Business one SDK help center
Dim oGeneralService As SAPbobsCOM.GeneralService
Dim oGeneralData As
SAPbobsCOM.GeneralData
Dim oSons As SAPbobsCOM.GeneralDataCollection
Dim oSon As
SAPbobsCOM.GeneralData
Dim sCmp As SAPbobsCOM.CompanyService
sCmp =
oCompany.GetCompanyService
'Get a handle to the
SM_MOR UDO
oGeneralService = sCmp.GetGeneralService("SM_MOR")
'Specify data for main
UDO
oGeneralData =
oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralData)
oGeneralData.SetProperty("U_Room", "1")
oGeneralData.SetProperty("U_Price", "20")
oGeneralData.SetProperty("U_Name", "David")
'Specify data for child UDO
oSons =
oGeneralData.Child("SM_MOR1")
oSon =
oSons.Add
oSon.SetProperty("U_MainDish", "Chicken")
oSon.SetProperty("U_SideDish", "Fries")
oSon.SetProperty("U_Drink", "Cola")
'Add records
oGeneralService.Add(oGeneralData)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
It,s Work through UDO Process Creation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
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.