pp108 : edit()

edit()


It returns the appropriate business object for editing.

Syntax

Script modelId.edit (oBusinessObject)


Values

oBusinessObject This parameter is optional. Denotes the business object that is to be edited or changed. If no business object is found in the model data, the edit() method returns null. If not specified, the business object of the activeTuple is returned for editing.


Remarks


The parameter for this method is optional, and in case not specified, the current activeTuple's business object is returned for editing.

Sample Code


The following code takes a tuple for editing and changes a value in its node.

//No parameter is specified, so the activeTuple's business object is returned
var currentBusinessObject = EmployeesModel.edit();
//Modify a node inside the tuple
var reportsToNode  = cordys.selectXMLNode(currentBusinessObject,".//*[local-name()='ReportsTo']");
if(cordys.getTextContent(reportsToNode) == "1000") cordys.setNodeText(reportsToNode,"4000");
//Refresh the Employees Table to see modifications in view
EmployeesTable.rebind();

Applies to


Model