bool PrxMetaUserButtonsUpdate(string mon, PrxMetaUserButtonUpdateActions tArg)
mon. Moniker for working with user buttons.
tArg. Operation execution parameters.
The PrxMetaUserButtonsUpdate operation updates the collection of user buttons in a regular report.
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.
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.
{
"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"
}
}
}
}
]
}
}
}
}
{
"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: