Open Dynamic Web Resources with Parameters in Dynamics 365 Using a Form Button

Open Dynamic Web Resources with Parameters in Dynamics 365 Using a Form Button

Open Dynamic Web Resources with Parameters in Dynamics 365 Using a Form Button

In Dynamics 365, enhancing forms with custom buttons is a powerful way to streamline processes and improve user experience. This blog post will guide you through adding a button to a form, attaching a JavaScript function to handle the click event, and dynamically opening a web resource by passing multiple parameters. We’ll also cover how to use those parameters to display dynamic content and execute specific actions within the web resource.

Steps to Add a Button and Implement the Functionality

1.Add a Custom Button to the Form

Use the Ribbon Workbench in Dynamics 365 to add a custom button to the desired entity form.

Open Dynamic Web Resources with Parameters in Dynamics 365 Using a Form Button

  • Configure the button’s properties, such as label, icon, and display rules.
  • Link the button to a JavaScript web resource for the on-click action.

Open Dynamic Web Resources with Parameters in Dynamics 365 Using a Form Button

2. Attach a JavaScript Function

Write a JavaScript function that will execute when the button is clicked. Use the Xrm.Navigation.navigateTo method to open the HTML web resource.

Pass parameters to the web resource through a query string. Here’s an example:

screenshot showing how  Attach a JavaScript Function

Getting the Parameters values in the custom web resource.

Adding dynamic content based on the values that came from parameters.

snapshot of code showing Adding dynamic content based on the values that came from parameters.

Output: Based on the dynamic parameters values.

Output: Based on the dynamic parameters values.

3. Create the HTML Web Resource

Build an HTML web resource to render dynamic content based on the parameters passed. Use JavaScript in the web resource to parse the query string and fetch the data. Example:

4. Perform Actions Based on Dynamic Content

Add event listeners or buttons within the web resource to perform actions based on the displayed data. Example: Execute an API call or update records using the Dynamics 365 Web API based on user input within the web resource.

5. Test the Integration

Publish all customizations and test the functionality by clicking the button in the form. Verify that the web resource opens, displays dynamic content, and performs the desired actions.

Benefits of This Approach

  • Customizable User Experience: Tailor forms and interactions to meet specific business requirements.
  • Dynamic Content Rendering: Pass relevant data from the form to the web resource for contextualized interactions.
  • Streamlined Workflows: Allow users to perform actions without leaving the Dynamics 365 interface.

Conclusion

By adding a button to a form and leveraging the power of web resources and JavaScript, you can deliver a seamless and dynamic user experience. Implement this functionality to empower your team with more intuitive and efficient workflows.

Explore SkySoft Connections Dynamics CRM Services

?

要查看或添加评论,请登录

SkySoft Connections的更多文章

社区洞察

其他会员也浏览了