Introduced in QPR 7.5.1
Last changed in QPR 2012
Creates a new object of the type defined in the function call to the model. Note that in the case the object does not have parameters that define its parent model element, you will need to attach the object to a model element separately using the AttachObject function. The following object types are supported:
•INFORMATIONITEM (element type id -7)
•ALERT (element type id -18). By default, the alert will be created with the "Value changed > Immediately when value changes" setting and the recipient is the user that has executed the CreateObject command.
•LINKED ELEMENT (id of the linked element type)
SCModel.CreateObject(ObjectType, Name, Parameters, out ObjectId)
ObjectType: String | Integer. Object type name (string) or id (integer). See the listing above for supported object types.
Name: Name of the object. String. Optional. If the name parameter is left empty, a default name is generated.
Parameters: String. A semicolon-separated list of parameters for object creation. The parameters available for different object types are listed below:
INFORMATIONITEM: no supported parameters. Use an empty string.
ALERT: parameters are defined as "Parameter Name=Value"
•ELEMENTID: Integer. ID of the measure for which the alert is created. Mandatory parameter.
•SERIES: Integer | String. ID of the series in the measure defined by ELEMENTID. This can be also a series identifier such as "ACT". Mandatory parameter.
•OWNERID: ID of the measure for which the new linked data element is created. Mandatory parameter.
ObjectId: Variant. ID of the newly created object is returned in this parameter.
Administrator or Model Administrator rights to the SCModel.
Below are listed the return values that this function can return:
iResult = SCModel.CreateObject("INFORMATIONITEM","Link to QPR WEB page","",oId)
iResult = SCModel.CreateObject("ALERT","A1","ELEMENTID=162166380;SERIES=ACT",OId)