Wednesday, August 10, 2011

MS CRM IFrame request parameters – the look and helper code

Providing for the joy of sharing itself. This is for MS CRM 3.0 and I hope no one really works with it now except for myself :). This is what is being sent when you check the box to send the type and entity id:

image

And here goes the helper code (client-side only) for it:

   1: <p id="debug">
   2:  
   3: </p>
   4:  
   5: <script type="text/javascript">
   6:  
   7:     function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for (var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; }
   8:  
   9:     var urlVars = getUrlVars()
  10:     for (rp in urlVars) {
  11:         $('#debug').append(rp + ":" + urlVars[rp] + "</br>")
  12:     }

Yours, Stan.

No comments: