• 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

Plugin Unsecure Configurations Made Easy

August 17, 2017   Microsoft Dynamics CRM
steps 300x225 Plugin Unsecure Configurations Made Easy

One of the more common use cases in Microsoft Dynamics 365 tends to be writing plugins and needing to pass parameters that the plugin code can use.

The traditional format to pass parameters has been XML that is pasted in the unsecure configuration. Parsing XML tends to be cumbersome and one ends up writing more code and spends more time maintaining that code rather than focusing on the business logic within the plugin. The question is: can we do any better?

Yes, there is a better way! The following process is what we tend to use to simplify this task:

Step 1

Build a class that contains the variables that you want to pass in through the unsecure configuration.

For the purposes of our example, our class definition looks like the screenshot below.

081517 2001 PluginUnsec1 Plugin Unsecure Configurations Made Easy

Step 2

Instantiate the object and serialize it. You could use JSON.NET or write your own. In either case, the serialized output will be similar to below.

081517 2001 PluginUnsec2 Plugin Unsecure Configurations Made Easy

Step 3

Paste the JSON in the unsecure config of your plugin step.

081517 2001 PluginUnsec3 Plugin Unsecure Configurations Made Easy

Step 4

In your plugin code, deserialize the JSON as follows

081517 2001 PluginUnsec4 Plugin Unsecure Configurations Made Easy

Code for the Deserialize method is below.

081517 2001 PluginUnsec5 Plugin Unsecure Configurations Made Easy

Sample code for the JsonHelper class was derived from this Microsoft article.

Step 5

Now you are free to use variables defined within the reserialized object as you need in your plugin code. Mission accomplished!

For additional information, check out the following blogs:

Comparison: Using Workflows vs. JavaScript vs. Plugins in Dynamics 365

Setting Output Parameters in Plugins for Custom Actions

Happy Dynamics 365’ing!

Let’s block ads! (Why?)

PowerObjects- Bringing Focus to Dynamics CRM

Configurations, Easy, Made, plugin, Unsecure
  • Recent Posts

    • Accelerate Your Data Strategies and Investments to Stay Competitive in the Banking Sector
    • SQL Server Security – Fixed server and database roles
    • Teradata Named a Leader in Cloud Data Warehouse Evaluation by Independent Research Firm
    • Derivative of a norm
    • TODAY’S OPEN THREAD
  • Categories

  • Archives

    • April 2021
    • March 2021
    • February 2021
    • 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