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

Ribbon workbench (Part-3) for Dynamics 365- Add a custom button on entity form in Account with JavaScript action to read Form Fields

Ribbon workbench (Part-3) for Dynamics 365- Add a custom button on entity form in Account with JavaScript action to read Form Fields

In our previous article we have seen how we can add a button and on click on button how to open an external or internal URL. now in this post we will see how we can call a JavaScript on button click.

Follow the previous blog to know how to add button and add command but in command instead of adding URL action choose JavaScript action.

But before that we have to create a JavaScript web resource. Open any custom solution and add a new web resource of type JavaScript.

We will read the Account name and show the account name as an JavaScript alert. So we will use below script to read Account name.

function ShowMessage(executionContext)
{
   var formContext = executionContext;
   var accountName = formContext.getAttribute("name").getValue();
    alert(accountName);
}

In the above script the parameter executionContext will be passed from Ribbon Workbench.

After the JavaScript web resource is created open ribbon workbench and choose the solution containing the entity now add a button named as ‘Show Message’ and add a command for the button with JavaScript Action.

in the Custom Javascript Action select the library javascript and supply the function name as ShowMessage as in the javascript function we have mentioned the name of function ShowMessage.

Now click on Add parameter and choose CRM parameter and choose the Value as Primary Control.

Now Publish the Ribbon workbench solution.

After it is published refresh an existing Account form and you will see a new button called “Show Message” and on clicking the show message the account name will be displayed.

Follow my blog for more trending topics on Dynamics 365, Azure, C#, Power Portals and Power Platform. For training, Courses and consulting, call to us at +91 832 886 5778 I am working more for community to share skills in Dynamics 365 and Power Platform. Please support me by subscribing my YouTube Channel. My YouTube Channel link is this : https://www.youtube.com/user/sppmaestro

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

 

2 Responses

  1. […] In our earlier article now we have seen how we are able to add a button and on click on on button learn how to open an exterior or inside URL. now on this put up we are going to see how we are able to name a JavaScript on button click on. Comply with the earlier weblog to know learn how to add button and add command… Learn extra […]

Comments are closed.