As per my R&D and support ticket with Microsoft, we are still not able to add dynamic Flyout menu buttons directly in Unified Interface (UCI).
The issue is due to the dynamic buttons don’t detect the command that we were adding through our JS code, so we need to attach that command to a hidden button so that internally the command is visible.
Step#1: Adding a button, where you need to call the command that we have used for dynamic buttons.
Add a flyout button and make it hidden.
Add a menu section and then add a button, and call the command here.
function populateEnrollmentFlyout(commandProperties) {
var programsRibbonXml = "";
var programs = retrieveMultiple('msd_programs', "?$select=msd_programid,msd_name");
var command="msd.lead.Command.ProgramClicked";
//This code is used to build the command string for UCI
if(commandProperties.SourceControlId!=null)
{
var source=commandProperties.SourceControlId.split('|');
if(source.length>3)
{
//command="lead|NoRelationship|Form|msd.lead.Command.ProgramClicked"
command=source[0]+"|"+source[1]+"|"+source[2]+"|"+command;
}
}
programsRibbonXml +=""
if (programs != null) {
for (var i = 0; i < programs.length; i++) {
var Name = programs[i].msd_name;
var Value = programs[i].msd_programid;
programsRibbonXml+=""
}
}
programsRibbonXml +="";
commandProperties["PopulationXML"] = '' + programsRibbonXml + "";
}
function programClicked(commandProperties) {
alert ("program with id "+commandProperties.SourceControlId +" selected.");
}
Finally, the dynamic menu buttons will be shown in both Web client & Unified Interface.
Hope it will help!
Leave a Reply