Add Dynamics FLY Button on Form in MS CRM

1.       Open ribbon work bench tool with entity

2.       Drag the FLYOUT button from tool box to the form.


3.       Enter Title, Label and Required Information 

4.  Add the Two Commands

Add Custom JavaScript Action Include Library and Function Name to the both Commands

6.       Add Crm Parameter: Command Properties to Action.


7.       Add both the commands to FLYOUT button


8.       JavaScript on prepopulate menu button click

printFlyOutMenuButton_onClick: function (cmdProperties) {

a.  var command = "new.new_lead.printFlyoutbutton.Command";

(---copy the command from the ribbon workbench)

b.  cmdProperties.PopulationXML = '<Menu Id=" new.new_lead.print_btn">' +

                       i.   '<MenuSection Id=" new.new_lead.PrintSelect" Sequence="10">' +

                     ii.   '<Controls Id=" new.new_lead.PrintControls">';

c.  cmdProperties.PopulationXML += createDynamicButton("new.new_lead.printbtn_form", command, "20", "Print Form", "Print Form");

d.  cmdProperties.PopulationXML += '</Controls></MenuSection></Menu>';

e.  return;

},

 

createDynamicButton: function (id, command, sequence, label, toolTipTitle) {

                       i.   return '<Button Id="' + id +

                     ii.   '" Command="' + command + '" Sequence="' + sequence

                    iii.   + '" LabelText="' + label

                     iv.   + '" ToolTipTitle="' + toolTipTitle

                       v.   + '"/>';

f.  },

9.  JavaScript on button click

printFlyOutButton_Click: function (cmdProperties) {

a.  debugger;

b.  if (cmdProperties.SourceControlId === " new.new_lead.printbtn_form") {

                       i.   alert("verification");

c.  }

},



Comments

Popular posts from this blog

Display SSRS Report in CRM Dashboard with Paging and Hyperlink