locked
How to pass parameters to a plugin RRS feed

  • Question

  • Hi,
        Can anyone tell me how to pass parameters to a plugin. When i surfed internet i found an article, but in that they are passing 2 parameters to constructor. one is secure info and the other is unsecure info. 

    So is this the way to pass parameters to plugin?

    Regards,
    Sujatha Bhumireddy
    Tuesday, February 23, 2010 4:11 AM

Answers

  • Hi Sujatha,

    You are correct, this is the way to pass parameters to the plugin.  When you use the plug-in registration tool for registering your plugins, you will specific individual steps for each entity/message (account/create, lead/update, etc) you want to hook into.  During the process of registering a step, there is a section for unsecure and secure configurations.  These are just text areas for free form text.  The text you enter here is passed as a string to the secure and unsecure parameters in the plugin constructure.  What I have done for passing parameters is to put an XML format type string into the unsecure or secure area and in my code read the string into an XMLDocument object and parse the XML from there.  So for example, if I wanted to pass an extermal url to the plugin I could set my unsecure string to be:

    <Configuration><MyUrl>http://www.microsoft.com</MyUrl></Configuration>

    Then I can get the value by calling (assuming my XMLDocument object is named doc):

    doc.selectSingleNode("//MyUrl").InnerText

    Hope this helps,
    Dave 
    Tuesday, February 23, 2010 4:43 AM

All replies

  • Hi Sujatha,

    You are correct, this is the way to pass parameters to the plugin.  When you use the plug-in registration tool for registering your plugins, you will specific individual steps for each entity/message (account/create, lead/update, etc) you want to hook into.  During the process of registering a step, there is a section for unsecure and secure configurations.  These are just text areas for free form text.  The text you enter here is passed as a string to the secure and unsecure parameters in the plugin constructure.  What I have done for passing parameters is to put an XML format type string into the unsecure or secure area and in my code read the string into an XMLDocument object and parse the XML from there.  So for example, if I wanted to pass an extermal url to the plugin I could set my unsecure string to be:

    <Configuration><MyUrl>http://www.microsoft.com</MyUrl></Configuration>

    Then I can get the value by calling (assuming my XMLDocument object is named doc):

    doc.selectSingleNode("//MyUrl").InnerText

    Hope this helps,
    Dave 
    Tuesday, February 23, 2010 4:43 AM
  • Thanks Dave I am looking  for this solution.

     

    Thursday, October 6, 2011 1:13 PM