Web Service > Web Service Operations > Working with Development Environment > OpenWebForm
OpenWebFormResult OpenWebForm(OdId tOb, OpenWebFormArg tArg)
tOb. Moniker of repository object that is a web form.
tArg. Operation execution parameters.
The OpenWebForm operation opens a web form.
The operation allows for getting access to metadata and web form code. To execute the operation, in the tOb field specify moniker of the repository object that is a web form, and in the tArg field specify opening parameters. The moniker can be obtained on executing the GetObjects operation. In the tArg.meta field specify empty values or default values for the fields, which values should be obtained.
The operation results in the moniker of opened web form instance and metadata if the tArg.meta field was defined.
Below is the example of opening a web form. The request contains moniker of the repository object that is a web form. The response contains moniker of opened web form instance.
The example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.
{
"OpenWebForm" :
{
"tOb" :
{
"id" : "OLFDALNNBBFEGOAEGJFAPCEOMHPCOHIEIKADOOOFNHINOGAL!M!402446"
},
"tArg" :
{
"args" :
{
"openForEdit" : "true"
},
"meta" :
{
"text" : ""
}
}
}
}
{
"OpenWebFormResult" :
{
"id" :
{
"id" : "OLFDALNNBBFEGOAEGJFAPCEOMHPCOHIEIKADOOOFNHINOGAL!M!S!WFCLOMMLNNBBFEGOAEMLACIMNEFMDKNONEJKFAOPKOCKGPLBAH"
},
"meta" :
{
"text" : "Class OBJ402445WebForm: WebForm \tButton1: WebButton; \tInput2: WebInput; \tLabel2: WebLabel; \tInput1: WebInput; \tLabel1: WebLabel; \t End Class OBJ402445WebForm;"
}
}
}
public static OpenWebFormResult OpenWebForm(MbId mb, string formId, bool forEdit = false)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tOpen = new OpenWebForm()
{
tArg = new OpenWebFormArg()
{
args = new WebFormOpenArgs()
{
openForEdit = forEdit
},
meta = new GetWebFormMD()
{
text = string.Empty
}
},
// Create object moniker
tOb = new OdId() { id = mb.id + "!" + FindObjectById(mb, formId).k }
};
// Open web form
var result = somClient.OpenWebForm(tOpen);
return result;
}
See also: