pp108 : getInstance()

getInstance()


It creates an instance object in the current form.

Syntax

Script

oInstance = WebForm.getInstance(vIndex, sUpdateNamespace, sBusinessObjectName, oHostApplication)


Parameters

Parameter

Description

vIndex

Variant that contains an array of business attribute names which helps in uniquely identifying a business object from the instance. This will be the parameter used for doing a find operation at runtime. If there are no parameters this can be "" or null.

sUpdateNamespace

String that denotes the namespace used to synchronize with the application service (for update).

sBusinessObjectName

String that denotes the business object name of the retrieved data. This will be used while creating a new object instance (a new record) too.

oHostApplication

Object that denotes the application from which the instance is created.


Return Value


Returns the object that denotes the instance created.

Remarks


An instance gives basic information about the data itself, like the key to identify a business object, its namespace, or organization information. After an instance is created, a model has to be created that has a one-to-one relationship with the instance. The model will be used to communicate with the application service.

Example

This sample code demonstrates how the method can be used.

var employeesIndex = new Array("EmployeeID", "ReportsTo");
var employeesNamespace = "http://schemas.cordys.com/Employees";
//Create new instance
var newInstance = WebForm.getInstance(employeesIndex, employeesNamespace, "Employees", application);

Applies to


WebForm

Related reference

Instance
getModel()
Model
Non-transactional - nontransactional (Model)