CreateCustomOb

Syntax

CreateCustomObResult CreateCustomOb(OdId tParent, CreateCustomObArg tArg)

Parameters

tParent. Moniker of parent object, in which a custom class object is created.

tArg. Operation execution parameters.

Description

The CreateCustomOb operation creates a custom class object.

Comments

To execute the operation, in the tParent field specify parent object moniker, and in the tArg.classId field specify identifier of created object class. Class identifier is available in custom class metadata that can be obtained using the OpenCustomExtender, GetCustomExtender operations.

The operation results in the moniker and description of the created class. The object is created as a temporary one, it should be saved to appear in the repository.

If a web form is set for the object class of the operation, the operation results in the key of this web form. Further work with the obtained object is executed using the GetCustomOb, SetCustomOb operations or on the web form. To open the web form, use the OpenWebForm operation, object information is sent in the cstmArgs field. In order the object is appeared in the repository, it should be saved. The object can be saved in web form code or using the SaveObject/SaveObjectAs operation.

Example

Below is the example of creating a custom class object. The request contains parent folder moniker or identifier of created object class. The response contains the moniker and description of the created temporary object.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CreateCustomOb xmlns="http://www.fsight.ru/PP.SOM.Som">
<tParent xmlns="">
  <id>KIJGJLGLBNIEGOAEKKDNNHHCKMKIANEEPIGPOKBNCCCNDLDC!M!10099</id>
  </tParent>
<tArg xmlns="">
  <classId>2168577</classId>
  </tArg>
  </CreateCustomOb>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<CreateCustomObResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<createResult xmlns="">
<id>
  <id>KIJGJLGLBNIEGOAEKKDNNHHCKMKIANEEPIGPOKBNCCCNDLDC!M!S!OGJDCJCHLBNIEGOAEEJEBKIOHBNBIFPPEIIEEIAFBMGNGGONL</id>
  </id>
<object ds="" isShortcut="0" isLink="0" ver="1" hf="0">
  <i>OBJ10106</i>
  <n>Custom object</n>
  <k>10106</k>
  <c>2168577</c>
  <p>10099</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  </object>
  </createResult>
  </CreateCustomObResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"CreateCustomOb" :
{
"tParent" :
{
"id" : "KIJGJLGLBNIEGOAEKKDNNHHCKMKIANEEPIGPOKBNCCCNDLDC!M!10099"
},
"tArg" :
{
"classId" : "2168577"
}
}
}

JSON response:

{
"CreateCustomObResult" :
{
"createResult" :
{
"id" :
{
"id" : "KIJGJLGLBNIEGOAEKKDNNHHCKMKIANEEPIGPOKBNCCCNDLDC!M!S!OGJDCJCHLBNIEGOAEEJEBKIOHBNBIFPPEIIEEIAFBMGNGGONL"
},
"object" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "1",
"@hf" : "0",
"i" : "OBJ10106",
"n" : "Custom object",
"k" : "10106",
"c" : "2168577",
"p" : "10099",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
}
}
}
}
public static CreateCustomObResult CreateCustomOb(string parentMon, uint classId)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tNew = new CreateCustomOb()
{
tArg = new CreateCustomObArg()
{
classId = classId
},
tParent = new OdId() { id = parentMon }
};
// Create a custom class object
var tResult = somClient.CreateCustomOb(tNew);
return tResult;
}

See also:

Working with Custom Class Objects