CreateBusinessObject 

Creates an instance of a business object.

Syntax

Function CreateBusinessObject(objName As String, [pVarParams], [pVarValues]) As BusinessObject

Parameters

objName

Required; Specifies the name of the business object to be created.

[pvarParams]

Optional [in]; Two possible values:

  • The primary key of the Business Object. If you don’t specifiy a primary key, the framework will automatically generate the primary key for the newly created Business Object.
  • An array of Transaction Parameters that need to be set for the transaction of the Business Object. If the Business Object is created through relations, the Tranasaction parameter names will be filled.

[pVarValues]

Optional [in]; Two possibilities:

  • If you have passed the primary key of the Business Object as the pVarParams parameter, this parameter is not required.
  • If you have passed the array of Transaction Parameters as the pVarParams parameter, you must pass the corresponding values for the Transaction Parameters.

Return Values

Returns the business object if it is created successfully, otherwise NULL.

Remarks

It creates an instance of a business object (new or existing) depending on the parameters passed.

Error Data

Error Code

Error message

Reason

E_BOF_CREATE_BOPROXY

"Could not create Proxy Business Object"

The Sfabofd.dll might not be registered.

E_BF_CREATE_VBAOBJECT

"Could not create Extended VBA object"

Vbahost.dll or vbahost.exe might not be registered correctly

The VBA class module associated with the BussinessObject has compilation errors

E_BF_EXBOGETIDSOFNAME

"Extended objects's GetIDsOfName failed"

The function or property being accessed is not defined in the VBA class module.

E_BF_INVALIDPK

"Invalid Primary Key"

The primary key specified does not exist in the DataBase