Render hidden values in "tester" mode by using querystring parameters


One way of doing verification on your logic in “build” mode is to use querystring parameters to render you MSCRM gui/logic different.

  • Verification during testing
  • Version verification of js-script running in current release
  • Link new buttons with extra querystring parameters attached in ISV/Sitemap config
  • Etc

Querystring parameter

Notice how the title is changed to current version of the onload script



style='font-size:10.0pt;font-family:"Courier New";color:green'>//Place in
onload of entity

style='font-size:10.0pt;font-family:"Courier New";color:blue'>if style='font-size:10.0pt;font-family:"Courier New"'>
(GetItemFromQueryString("tester") == "yes") style='mso-tab-count:1'> 

style='font-size:10.0pt;font-family:"Courier New"'>      document.title = "Entity in TESTER mode [" +
JS_VERSION + "]";

style='font-size:10.0pt;font-family:"Courier New";color:blue'>else

style='font-size:10.0pt;font-family:"Courier New"'>{

style='font-size:10.0pt;font-family:"Courier New"'>      //Hidden fields logic or something
else

style='font-size:10.0pt;font-family:"Courier New"'>}

style='font-size:10.0pt;font-family:"Arial","sans-serif"'> 

style='font-size:10.0pt;font-family:"Courier New";color:blue'>function style='font-size:10.0pt;font-family:"Courier New"'>
GetItemFromQueryString(name)

style='font-size:10.0pt;font-family:"Courier New"'>{

style='font-size:10.0pt;font-family:"Courier New"'>      var regexS = "[\\?&]"
+ name + "=([^&#]*)";

style='font-size:10.0pt;font-family:"Courier New"'>      var regex = style='color:blue'>new RegExp(regexS);

style='font-size:10.0pt;font-family:"Courier New"'>      var tmpURL =
window.location.href;

style='font-size:10.0pt;font-family:"Courier New"'>      var results =
regex.exec(tmpURL);

style='font-size:10.0pt;font-family:"Courier New"'>      if (results == style='color:blue'>null)

style='font-size:10.0pt;font-family:"Courier New"'>            return "";

style='font-size:10.0pt;font-family:"Courier New"'>      else

style='font-size:10.0pt;font-family:"Courier New"'>            return results[1];

style='font-size:10.0pt;font-family:"Courier New"'>}

style='font-size:10.0pt;font-family:"Arial","sans-serif"'> 

Comments (0)

Skip to main content