PrxMetaUserButtonsUpdate

Syntax

bool PrxMetaUserButtonsUpdate(string mon, PrxMetaUserButtonUpdateActions tArg)

Parameters

mon. Moniker for working with user buttons.

tArg. Operation execution parameters.

Description

The PrxMetaUserButtonsUpdate operation updates the collection of user buttons in a regular report.

Comments

The operation updates user button settings, create new or delete existing user buttons. To execute the operation, in the mon field specify moniker of opened regular report instance with the !UserButtons postfix, and in the tArg.its field specify the collection of elements with information about executed actions with user buttons.

If a user button is deleted, specify button key in executed action settings. When creating or updating user buttons, specify all required settings.

The operation results in the logical true if the collection of user buttons is updated successfully.

Example

Below is the example of updating user button settings and creating a new user button inn a regular report. The request contains moniker for working with user buttons and the collection of elements with required settings for execution of specified actions. The response contains whether the collection of user buttons is changed successfully.

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">
<PrxMetaUserButtonsUpdate xmlns="http://www.fsight.ru/PP.SOM.Som">
  <mon xmlns="">JODKPOHMDJDAGOAEDJEGAHKDCGKLNBKELJDOLPPMKPDKLOBJ!M!S!PPPOIKAIMDJDAGOAEJMPKOFKAHPDEMIFECIIMIGJAMMBGHKDB!UserButtons</mon>
<tArg xmlns="">
<its>
<it>
  <action>Update</action>
<button>
  <k>1</k>
  <n>Set up</n>
  </button>
  </it>
<it>
  <action>Add</action>
<button>
  <k>5</k>
  <n>Create</n>
  <type>Method</type>
<foreModule>
  <i>OBJ339238</i>
  <n>Unit</n>
  <k>339238</k>
  <c>0</c>
  </foreModule>
<action>
<method>
  <foreMethod>NewObject</foreMethod>
  </method>
  </action>
  </button>
  </it>
  </its>
  </tArg>
  </PrxMetaUserButtonsUpdate>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <PrxMetaUserButtonsUpdateResult 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">1</PrxMetaUserButtonsUpdateResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"PrxMetaUserButtonsUpdate" :
{
"mon" : "JODKPOHMDJDAGOAEDJEGAHKDCGKLNBKELJDOLPPMKPDKLOBJ!M!S!PPPOIKAIMDJDAGOAEJMPKOFKAHPDEMIFECIIMIGJAMMBGHKDB!UserButtons",
"tArg" :
{
"its" :
{
"it" :
[
{
"action" : "Update",
"button" :
{
"k" : "1",
"n" : "Set up"
}
},
{
"action" : "Add",
"button" :
{
"k" : "5",
"n" : "Create",
"type" : "Method",
"foreModule" :
{
"i" : "OBJ339238",
"n" : "Module",
"k" : "339238",
"c" : "0"
},
"action" :
{
"method" :
{
"foreMethod" : "NewObject"
}
}
}
}
]
}
}
}
}

JSON response:

{
"PrxMetaUserButtonsUpdateResult" : "1"
}
public static bool PrxMetaUserButtonsUpdate(MbId mb, string moniker, string moduleId)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
var moduleOd = FindObjectById(mb, moduleId);
// Operation execution parameters
var tChange = new PrxMetaUserButtonsUpdate()
{
mon = moniker + "!UserButtons",
tArg = new PrxMetaUserButtonUpdateActions()
{
its = new PrxMetaUserButtonUpdateAction[]
{
new PrxMetaUserButtonUpdateAction()
{
action = PrxMetaUserButtonUpdateActionType.Update,
button = new PrxMetaUserButton()
{
k = 1,
n = "Set up"
}
},
new PrxMetaUserButtonUpdateAction()
{
action = PrxMetaUserButtonUpdateActionType.Add,
button = new PrxMetaUserButton()
{
k = 5,
n = "Create",
foreModule = new Ob()
{
i = moduleId,
n = moduleOd.n,
k = moduleOd.k
},
type = PrxMetaUserButtonType.Method,
action = new PrxMetaUserButtonAction()
{
method = new PrxMetaUserButtonActionMethod()
{
foreMethod = "NewObject"
}
}
}
},
}
}
};
// Change collection of user buttons
var result = somClient.PrxMetaUserButtonsUpdate(tChange);
return result;
}

See also:

Working with Regular Reports