Importing QueryStringParameter throws Duplicate Key sequence Exception RRS feed

  • Question

  • When importing a solution that contains a form which has a QueryStringParameter, we receive a duplicate key sequence exception.  This is a result of the of CRM platform always marking the formparameters node with a solution action of 'Added'; thus when we import the solution to make an update on the form, we get an error that reads "There is a duplicate key sequence '#parameter_name#' for the 'UniqueName' key or unique identity constraint."  Based on the platform adding the solutionaction="Added" attribute to the node, this makes since (i.e. the platform thinks you're adding a new parameter that matches the name of an existing parameter).  The question I have is what can be done to force the platform to

    Check if the parameter already exists

    Add it if it doesn't exist


    update it should a form parameter with the same name already be present on the form. 

    Monday, January 19, 2015 9:14 PM

All replies

  • I forgot to mention one thing.  If I unzip the solution and manual update the customization.xml file by removing the solutionaction attribute from the formparameters node, the solution imports without error and properly adds/updates the form. While this works, remembering to manually edit the customization.xml file isn't a thing I want our DevOp folks to be done.  FYI, ideally we also won't have to update the build script to manually remove the solutionaction nodes. 


    <formparameters solutionaction="Added">
      <querystringparameter name="parameter_foo" type="SafeString" />


      <querystringparameter name="parameter_foo" type="SafeString" />

    Monday, January 19, 2015 9:48 PM
  • Anyone else using query string parameters and encountering this issue with managed solutions?
    Friday, May 29, 2015 6:40 PM