Open phone call form with prefilled caller and direction using window.open
<p>How could one open a phone call entity form so that direction is Incoming and that in "From" field there's a contact. I know already who is calling and I have the GUID. I know it's always contact. And I know that phone call is always incoming.</p>

<p>I have to use window.open function and pass those values in url. This site (<a href="https://msdn.microsoft.com/en-us/library/gg334375.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/gg334375.aspx</a>) does explain how to provide values for option sets and lookups, but in phone call "From" field is not a simple lookup but party list. And direction is not an option set but a Two options (if that makes any difference).</p>

<p>I have simply tried this</p>

<pre><code>var extraqs = "directioncode=1&amp;from=" + contactid;
    window.open("https://myserver.crm4.dynamics.com/main.aspx?etn=phonecall&amp;pagetype=entityrecord&amp;extraqs=" + encodeURIComponent(extraqs));
</code></pre>

<p>but I can't get it work. I have tried to fiddle with those values back and forward and sometimes I get no error but it doesn't work either. Sometimes I get System.Web.HttpUnhandledException. I know it's probably because the format is off.</p>

<p>Another option I was thinkin that I could probably pass those values in url to the form and then create a function to form onLoad event where I could more easily set those field. But it sounds a workaround to me.</p>

<p>But my question is can I, and if how, set up those two fields?</p>