title: Dynamics CRM 2011 Pass Array as Parameter
body: <p>I have tried setting the parameter as:</p>
  
  <pre><code>array("item1","item2","item3")
  </code></pre>
  
  <p>and also as:</p>
  
  <pre><code>new array("item1","item2","item3")
  </code></pre>
  
  <p>and also as:</p>
  
  <pre><code>var Labels = new array("item1","item2","item3")
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/8xYcv.png" alt="enter image description here"></p>
  
  <p>but I can't seem to pass an array to the following function:</p>
  
  <pre><code>function BoldLabel(Labels) {
    var length = Labels.length;
    var element = null;
    for (var i = 0; i &lt; length; i++) {
      element = Labels[i];
      document.getElementById(element).style.fontWeight="bolder";
      document.getElementById(element).style.fontSize="13px";
    }
  }
  </code></pre>
  
  <p>I keep getting an "array is undefined" error. I thought for sure I saw this done somewhere but can't find the example anymore. The problem is that I'd like to be able to reuse this code and so just passing an array of the items I want to bold would be easier than cutting and pasting the code to a new function and writing in each label name individually like</p>
  
  <pre><code>document.getElementById("new_pricingsubtotal_c").style.fontWeight="bolder";
  document.getElementById("new_pricingsubtotal_c").style.fontSize="13px";
  document.getElementById("new_pricingsubtotal1_c").style.fontWeight="bolder";
  document.getElementById("new_pricingsubtotal1_c").style.fontSize="13px";
  document.getElementById("new_lineitemtotal_c").style.fontWeight="bolder";
  document.getElementById("new_lineitemtotal_c").style.fontSize="13px";
  document.getElementById("new_trucktotalcost_c").style.fontWeight="bolder";
  document.getElementById("new_trucktotalcost_c").style.fontSize="13px";
  </code></pre>
  
  <p>Any help with this would be greatly appreciated!!</p>