Bhubaneswar, Odisha, India
+91-8328865778
support@softchief.com

Add a button on Form Ribbon in Dynamics 365 Customer Engagement using Ribbon workbench and Form Context to Display Form Field Value

Add a button on Form Ribbon in Dynamics 365 Customer Engagement using Ribbon workbench and Form Context to Display Form Field Value

In this post we will see how to add buttons on an Entity form and attach a JavaScript event to interact with Form Fields using Form Context except Xrm.Page as Xrm.Page will not be used in future as per recommended by Microsoft.

So let’s start. First we have to create a JavaScript web resource named as “ribbon.js” and add a function with below code. And publish the web resource.

function ribbonmsg(primaryControl)
{
  var formContext = primaryControl;
  alert("Hello" + formContext.getAttribute("lastname").getValue()); 
};

Next we have to create a solution and add the entity for which you want to add button. For us we will use Contact entity.

Now download Ribbon Workbench and Import to Dynamics 365 using below URL.

https://www.develop1.net/public/rwb/ribbonworkbench.aspx

After import operation complete refresh the screen. You will see the below option on solutions window.

Then click on the Ribbon workbench option. It will open the Ribbon Workbench in a new window asking to choose a solution. Select the solution and proceed.

After selecting the OK button it will display the Unified Area where drag a button and drop at the correct location on Forms TAB as displayed below.

Now change the Label to “My Button”. Then add new command to select JavaScript function as given below.

Now choose the JavaScript library and the function and CRM Parameter as “primary control”

After this step associate the Command with Command Definition option of Button.

Now we are done. Click Publish. It will take couple of seconds to Publish. Now we will test the button.

Navigate to Sales, refresh the whole screen and Open any Contact record Form.

On clicking the button you will see the below alert.

That’s all. Thanks for reading. For training requirements contact below.

Call: 8328865778 Email: support@sh034.global.temp.domains

You can enroll now !We are giving 30% discount on our Internship Program

Don’t miss the chance to participate in the upcoming Internship Program which will be done using Microsoft Dot Net Web Development Full Stack Technology. The new batch will be starting from May 20, 2024.  We will have most experienced trainers for you to successfully complete the internship with live project experience.

Why to choose Our Internship Program?

Industry-Relevant Projects
Tailored Assignments: We offer projects that align with your academic background and career aspirations.
Real-World Challenges: Tackle industry-specific problems and contribute to meaningful projects that make a difference.

Professional Mentorship
Guidance from Experts: Benefit from one-on-one mentorship from seasoned professionals in your field.
Career Development Workshops: Participate in workshops that focus on resume building, interview skills, and career planning.

Networking Opportunities
Connect with Industry Leaders: Build relationships with professionals and expand your professional network.
Peer Interaction: Collaborate with fellow interns and exchange ideas, fostering a supportive and collaborative environment.

Skill Enhancement
Hands-On Experience: Gain practical skills and learn new technologies through project-based learning.
Soft Skills Development: Enhance communication, teamwork, and problem-solving skills essential for career success.

Free Demo Class Available