• Home
  • About Us
  • Contact Us
  • Privacy Policy
  • Special Offers
Business Intelligence Info
  • Business Intelligence
    • BI News and Info
    • Big Data
    • Mobile and Cloud
    • Self-Service BI
  • CRM
    • CRM News and Info
    • InfusionSoft
    • Microsoft Dynamics CRM
    • NetSuite
    • OnContact
    • Salesforce
    • Workbooks
  • Data Mining
    • Pentaho
    • Sisense
    • Tableau
    • TIBCO Spotfire
  • Data Warehousing
    • DWH News and Info
    • IBM DB2
    • Microsoft SQL Server
    • Oracle
    • Teradata
  • Predictive Analytics
    • FICO
    • KNIME
    • Mathematica
    • Matlab
    • Minitab
    • RapidMiner
    • Revolution
    • SAP
    • SAS/SPSS
  • Humor

Using Form Save with Custom Web Resources

November 13, 2018   Microsoft Dynamics CRM
using form save 300x225 Using Form Save with Custom Web Resources

Microsoft has provided plenty of tools for use when out-of-the-box customizations fall short. Using custom web resources on forms can be a powerful tool, but it should integrate seamlessly with the form. To accomplish this, the web resource can hook onto the save of the form. This provides an easy way for users to interact across the different parts of the form without having to worry about multiple toolbars. In today’s blog, we’ll show you how it’s done!

Let’s say we have a web resource that surfaces information from a different entity, or a different source all together, and allows user input. In just a few simple steps, we can save any data we need from the web resource at the same time as the form.

1. Retrieve initial modifiedon information:

var modifiedon = parent.Xrm.Page.getAttribute(“modifiedon”).getValue();

2. Set up callbacks:

parent.Xrm.Page.data.entity.addOnSave(function(context){

    //Trigger any necessary calls here

});

parent.Xrm.Page.getAttribute(“modifiedon”).addOnChange(function(context){

    modifiedOn = context.getFormContext().getAttribute(“modifiedon”).getValue();

});

3. Set modifiedon based on user interaction in the web resource:

If(WebResource Needs To Save){

    Xrm.Page.getAttribute(“modifiedon”).setValue(new Date());

}

else{

    Xrm.Page.getAttribute(“modifiedon”).setValue(modifiedOn);

}

While the user interacts with the web resource, it is setting the modifiedon field to either the saved date or a new date. This will make the form appear dirty whenever the web resource requires a save, or other function call, to happen. Users will no longer know they are interacting with a separate web resource.

We hope this comes in handy for you. For more tips and tricks – be sure to check out our blog!

Happy D365’ing!

Let’s block ads! (Why?)

PowerObjects- Bringing Focus to Dynamics CRM

Custom, form, Resources, Save, using
  • Recent Posts

    • P3 Jobs: Time to Come Home?
    • NOW, THIS IS WHAT I CALL AVANTE-GARDE!
    • Why the open banking movement is gaining momentum (VB Live)
    • OUR MAGNIFICENT UNIVERSE
    • What to Avoid When Creating an Intranet
  • Categories

  • Archives

    • January 2021
    • December 2020
    • November 2020
    • October 2020
    • September 2020
    • August 2020
    • July 2020
    • June 2020
    • May 2020
    • April 2020
    • March 2020
    • February 2020
    • January 2020
    • December 2019
    • November 2019
    • October 2019
    • September 2019
    • August 2019
    • July 2019
    • June 2019
    • May 2019
    • April 2019
    • March 2019
    • February 2019
    • January 2019
    • December 2018
    • November 2018
    • October 2018
    • September 2018
    • August 2018
    • July 2018
    • June 2018
    • May 2018
    • April 2018
    • March 2018
    • February 2018
    • January 2018
    • December 2017
    • November 2017
    • October 2017
    • September 2017
    • August 2017
    • July 2017
    • June 2017
    • May 2017
    • April 2017
    • March 2017
    • February 2017
    • January 2017
    • December 2016
    • November 2016
    • October 2016
    • September 2016
    • August 2016
    • July 2016
    • June 2016
    • May 2016
    • April 2016
    • March 2016
    • February 2016
    • January 2016
    • December 2015
    • November 2015
    • October 2015
    • September 2015
    • August 2015
    • July 2015
    • June 2015
    • May 2015
    • April 2015
    • March 2015
    • February 2015
    • January 2015
    • December 2014
    • November 2014
© 2021 Business Intelligence Info
Power BI Training | G Com Solutions Limited