Below is the example of creating a new custom class. The request contains moniker of opened custom class container instance and the pattern indicating whether it is necessary to create a new class. The response contains the updated list of existing custom classes.
{
"SetCustomExtender" :
{
"tCustomExtender" :
{
"id" : "JFHDCPAHAHHCGOAEINHJAHNJDKAOLMFEPJOPHAHKLDFBMCCP!M!S!EEMPBGPAHAHHCGOAEDPGADAFLDKKBEEAEKKOADCJKHIMOAOGI"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"parsOwnDefVals" : "true",
"classes" : "Add"
},
"meta" :
{
"classes" :
{
"its" :
{
"it" :
[
{
"k" : "-1",
"operations" :
{
"its" : ""
}
}
]
}
}
},
"metaGet" :
{
"obInst" : "true",
"parsOwnDefVals" : "true",
"all" : "true"
}
}
}
}
{
"SetCustomExtenderResult" :
{
"id" :
{
"id" : "JFHDCPAHAHHCGOAEINHJAHNJDKAOLMFEPJOPHAHKLDFBMCCP!M!S!EEMPBGPAHAHHCGOAEDPGADAFLDKKBEEAEKKOADCJKHIMOAOGI"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "13",
"@hf" : "0",
"i" : "OBJ52",
"n" : "System class additions",
"k" : "52",
"c" : "5889",
"p" : "0",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "1",
"classes" :
{
"its" :
{
"it" :
[
{
"@ic" : "1",
"k" : "19",
"id" : "COMPONENT",
"n" : "Component",
"vis" : "1",
"implURL" : "",
"c" : "1251073",
"h" : "0",
"implAssembly" : "MOD_COMPONENT_CLASS_HANDLER",
"implClass" : "ComponentClassHandler",
"description" : ""
},
{
"@ic" : "1",
"k" : "16",
"id" : "BUSINESS_APPLICATION",
"n" : "Business application",
"vis" : "1",
"implURL" : "",
"c" : "1054465",
"h" : "0",
"implAssembly" : "P10002_BUSINESS_APPLICATION_MOD",
"implClass" : "BusinessApplication",
"description" : "Designer of business application"
},
{
"@ic" : "1",
"k" : "32",
"id" : "DATA_ENTRY_FORM_CLASS",
"n" : "Data entry\/output form",
"vis" : "1",
"implURL" : "http:\/\/localhost\/FP_App_v10.x\/script\/operation.js",
"c" : "2103041",
"h" : "0",
"implAssembly" : "ASM_INPUT_FORM_V3_PRESENTERS",
"implClass" : "CustomClassOperationsHandler",
"description" : ""
},
{
"@ic" : "0",
"k" : "33",
"id" : "OBJ417",
"n" : "CustomClass",
"vis" : "1",
"implURL" : "",
"c" : "2168577",
"h" : "0",
"implClass" : "",
"description" : ""
}
]
}
}
}
}
}
public static SetCustomExtenderResult NewClassInCustomExtender(string moniker)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetCustomExtender()
{
tArg = new SetCustomExtenderArg()
{
pattern = new CustomExtenderMdPattern()
{
classes = ListOperation.Add
},
meta = new CustomExtenderMd()
{
classes = new CustomClasses()
{
its = new CustomClass[]
{
new CustomClass()
{
k = uint.MaxValue,
operations = new CustomOperations()
{
its = new CustomOperation[] { }
}
}
}
}
},
metaGet = new CustomExtenderMdPattern()
{
all = true
}
},
tCustomExtender = new CustomObId() { id = moniker }
};
// Create a custom class
var tResult = somClient.SetCustomExtender(tSet);
return tResult;
}
See also: