Opening Custom Class Object

Below is the example of using the OpenCustomOb operation for opening a custom class object. The request contains moniker of repository object. The response contains moniker of the object instance opened for edit.

The C# example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.

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">
<OpenCustomOb xmlns="http://www.fsight.ru/PP.SOM.Som">
<tOb xmlns="">
  <id>LDPFDGAHAHHCGOAEBAFLLHKHMOALEEDEMKDKCJAAKNELDHAE!M!38194</id>
  </tOb>
<tArg xmlns="">
<metaGet>
  <obInst>true</obInst>
  <parsOwnDefVals>true</parsOwnDefVals>
  <data>true</data>
  </metaGet>
  <openForEdit>true</openForEdit>
  </tArg>
  </OpenCustomOb>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<OpenCustomObResult 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">
<id xmlns="">
  <id>LDPFDGAHAHHCGOAEBAFLLHKHMOALEEDEMKDKCJAAKNELDHAE!M!S!TGHNHGJAHAHHCGOAENBPOBGJCGMEKKAFEILDEOPPCHPKFAHNO</id>
  </id>
<meta xmlns="">
<obInst>
<obDesc ds="" isShortcut="0" isLink="0" ver="1" hf="0">
  <i>CUST_OBJ</i>
  <n>Data handler</n>
  <k>38194</k>
  <c>71425</c>
  <p>38193</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  <isPermanent>1</isPermanent>
  <isTemp>0</isTemp>
  </obDesc>
  </obInst>
  <dirty>0</dirty>
<data>
<refs>
  <its />
  </refs>
  <content />
  </data>
  </meta>
  </OpenCustomObResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"OpenCustomOb" :
{
"tOb" :
{
"id" : "LDPFDGAHAHHCGOAEBAFLLHKHMOALEEDEMKDKCJAAKNELDHAE!M!38194"
},
"tArg" :
{
"metaGet" :
{
"obInst" : "true",
"parsOwnDefVals" : "true",
"data" : "true"
},
"openForEdit" : "true"
}
}
}

JSON response:

{
"OpenCustomObResult" :
{
"id" :
{
"id" : "LDPFDGAHAHHCGOAEBAFLLHKHMOALEEDEMKDKCJAAKNELDHAE!M!S!TGHNHGJAHAHHCGOAENBPOBGJCGMEKKAFEILDEOPPCHPKFAHNO"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "1",
"@hf" : "0",
"i" : "CUST_OBJ",
"n" : "Data handler",
"k" : "38194",
"c" : "71425",
"p" : "38193",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "0",
"data" :
{
"refs" :
{
"its" : ""
},
"content" : ""
}
}
}
}
public static OpenCustomObResult OpenCustomObject(MbId mb, string id)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tOpen = new OpenCustomOb()
{
tArg = new OpenCustomObArg()
{
openForEdit = true,
metaGet = new CustomObMdPattern()
{
data = true
}
},
tOb = new OdId() { id = mb.id + "!" + FindObjectById(mb, id).k }
};
// Open custom class object
var tResult = somClient.OpenCustomOb(tOpen);
return tResult;
}

See also:

OpenCustomOb: Operation