CRM Javascript to Check Entity Type
<p>I'm using CRM 2013, I'm writing a JavaScript to check if there is any 'Queue' type entity in the email participants list.</p>

<p>I'm stuck on the part, where I have to write the script to check for this Queue data type.</p>

<p>The MSDN article suggested to use <code>Xrm.Page.data.entity.getEntityName()</code>, however I'm not sure if it works if I plug-in the entity name in there like:</p>

<pre><code>toParty[indxAttendees].getEntityName()
</code></pre>

<p>Appreciate your help.</p>

<pre><code>function deleteSenderQueueFromEmail() {
  var formType = Xrm.Page.ui.getFormType();

  if (formType == 1 || formType == 2) {

    var toParty = Xrm.Page.getAttribute("to").getValue();
    var ccParty = Xrm.Page.getAttribute("cc").getValue();
    var bcParty = Xrm.Page.getAttribute("bcc").getValue();


    for (var indxAttendees = 0; indxAttendees &lt; toParty.length; indxAttendees++) {

      if (toParty[indxAttendees].getEntityName() == "queue") {
        //delete the queue from the list of participants
      }
    }
  }
}
</code></pre>