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.
{
"OpenCustomOb" :
{
"tOb" :
{
"id" : "LDPFDGAHAHHCGOAEBAFLLHKHMOALEEDEMKDKCJAAKNELDHAE!M!38194"
},
"tArg" :
{
"metaGet" :
{
"obInst" : "true",
"parsOwnDefVals" : "true",
"data" : "true"
},
"openForEdit" : "true"
}
}
}
{
"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: