In a connector there's a right-click context menu item for adding entries to a table.
Once clicked it opens an popup to fill in 3 parameters.
Is that possible through an automation script?
Probably it is possible with slnet, but I wonder if this has been done before.
Hi Jeroen,
Please find an example below.
public static void CreateClassMap(Engine engine, Element ThisElement, string ClassMapName)
{
int ContextMenuParameterId = 14199;SetDataMinerInfoMessage DmInfoMessage = new SetDataMinerInfoMessage
{
DataMinerID = ThisElement.DmaId,
ElementID = ThisElement.ElementId,
Sa2 = new SA
{
Sa = new string[] {
Guid.NewGuid().ToString(),
"1",
ClassMapName,
"ipv4"
}
},
Uia1 = new UIA
{
Uia = new uint[] {
(uint)ThisElement.DmaId,
(uint)ThisElement.ElementId,
(uint)ContextMenuParameterId
}
},
What = 287
};Engine.SLNet.SendSingleResponseMessage(DmInfoMessage);
}
Hi all, would like to add that while the answer from Ive is the correct answer to the question here and while it might be the quick win for any situation where the contextMenu code already pre-exists, a more proper solution is to make use of InterAppCalls. More details can be found in my answer to following Q&A: https://community.dataminer.services/question/triggering-context-menu-parameter-from-automation-script/
For completeness, I also had to fill in the DataMinerID in the SetDataMinerInfoMessage