locked
unable to create email activity in CRM RRS feed

  • Question

  • when attempting to create email in CRM 4.0, email window opens below but does not allow user to enter any details in the main message body field. The window also reports that there is an error on the page. (Refer screen print http://drop.io/4ssdwvn/asset/email-jpg for more information on this)

    On closing the window, a CRM error notification is displayed.  We have written script on email form load but it is working fine for all other users while only one specific user is getting this problem.

    The user is using IE6 and other users also uses IE6 but it is working fine for them.

    Any idea to fix this issue?




     
    Monday, September 7, 2009 12:14 PM

Answers

  • Hi.

    Your code can't cause error you retrieve. Try to clean up cash of your browser (Tools - General - Delete browsing history - Delete Temporary Internet Files in the case of IE 7.0). If this would not help I suggest you to open ticket in Microsoft support.
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Tuesday, September 8, 2009 12:37 PM
    Moderator

All replies

  • Hi.

    It seems that your script invoke this error. Could you paste this script here and message of error (when you close or save email form new screen will appear - click show details which will be sent to microsoft and also paste here).
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Monday, September 7, 2009 12:17 PM
    Moderator
  • Hi,

    If the script works fine for all users except one user then it could be a security issue. Try adding the MSCRM website as a trusted site on the users browswer and try again.

    If the user still expirences the same issue paste the script error message and the script that is causing the problem.


    Hassan.


    Hassan Hussain | http://hassanhussain.wordpress.com/
    • Proposed as answer by Hassan Hussain Monday, September 7, 2009 12:21 PM
    • Unproposed as answer by Mayank Pujara Tuesday, September 8, 2009 8:09 AM
    Monday, September 7, 2009 12:21 PM
  • This email form works fine for all other users..only this specific user has this problem..

    following is the error messge that specific user is getting ...see if you can catch anything ...


    Microsoft Dynamics CRM Error Report Contents

    <CrmScriptErrorReport>
      <ReportVersion>1.0</ReportVersion>
      <ScriptErrorDetails>
     <Message>Permission denied</Message>
     <Line>131</Line>
     <URL>/_static&#47;_controls&#47;emailbody&#47;messagebody.htc</URL>
     <PageURL>/activities&#47;email&#47;edit.aspx&#63;_InReplyToId&#61;&#37;7b792ADD7F-D990-DE11-9D37-001E4F336950&#37;7d&#38;crmFormSubmitMode&#61;8</PageURL>
     <Function>InitializeEmailBody&#40;&#41;</Function>
     <CallStack>
       <Function>InitializeEmailBody&#40;&#41;</Function>
       <Function>OnFrameContentReady&#40;&#41;</Function>
     </CallStack>
      </ScriptErrorDetails>
      <ClientInformation>
     <BrowserUserAgent>Mozilla&#47;4.0 &#40;compatible&#59; MSIE 6.0&#59; Windows NT 5.1&#59; SV1&#59; .NET CLR 1.1.4322&#59; .NET CLR 2.0.50727&#59; .NET CLR 3.0.04506.648&#59; .NET CLR 3.5.21022&#59; .NET CLR 1.0.3705&#59; .NET CLR 3.0.4506.2152&#59; .NET CLR 3.5.30729&#41;</BrowserUserAgent>
     <BrowserLanguage>en-us</BrowserLanguage>
     <SystemLanguage>en-gb</SystemLanguage>
     <UserLanguage>en-gb</UserLanguage>
     <ScreenResolution>1280x1024</ScreenResolution>
     <ClientName>Outlook Desktop</ClientName>
      </ClientInformation>
      <ServerInformation>
        <OrgLanguage>1033</OrgLanguage>
        <OrgCulture>2057</OrgCulture>
        <UserLanguage>1033</UserLanguage>
        <UserCulture>2057</UserCulture>
        <OrgID>&#123;CDFCC2A3-B3A6-DD11-B91D-0019BBD31BFC&#125;</OrgID>
        <UserID>&#123;949E5406-5C5A-DE11-A3B5-001E4F336950&#125;</UserID>
        <CRMVersion>4.0.7333.3</CRMVersion>
      </ServerInformation>
    </CrmScriptErrorReport>

    <CrmScriptErrorReport>
      <ReportVersion>1.0</ReportVersion>
      <ScriptErrorDetails>
     <Message>Permission denied</Message>
     <Line>625</Line>
     <URL>/_static&#47;_controls&#47;emailbody&#47;messagebody.htc</URL>
     <PageURL>/activities&#47;email&#47;edit.aspx&#63;_InReplyToId&#61;&#37;7b792ADD7F-D990-DE11-9D37-001E4F336950&#37;7d&#38;crmFormSubmitMode&#61;8</PageURL>
     <Function>HasDataSlug&#40;&#41;</Function>
     <CallStack>
       <Function>HasDataSlug&#40;&#41;</Function>
       <Function>getIsDataSlug&#40;&#41;</Function>
       <Function>BuildXml&#40;bValidate, bClose, bBuildFullXml, bValidateForWorkflow, bIsDirtyCheck&#41;</Function>
       <Function>Close&#40;&#41;</Function>
     </CallStack>
      </ScriptErrorDetails>
      <ClientInformation>
     <BrowserUserAgent>Mozilla&#47;4.0 &#40;compatible&#59; MSIE 6.0&#59; Windows NT 5.1&#59; SV1&#59; .NET CLR 1.1.4322&#59; .NET CLR 2.0.50727&#59; .NET CLR 3.0.04506.648&#59; .NET CLR 3.5.21022&#59; .NET CLR 1.0.3705&#59; .NET CLR 3.0.4506.2152&#59; .NET CLR 3.5.30729&#41;</BrowserUserAgent>
     <BrowserLanguage>en-us</BrowserLanguage>
     <SystemLanguage>en-gb</SystemLanguage>
     <UserLanguage>en-gb</UserLanguage>
     <ScreenResolution>1280x1024</ScreenResolution>
     <ClientName>Outlook Desktop</ClientName>
      </ClientInformation>
      <ServerInformation>
        <OrgLanguage>1033</OrgLanguage>
        <OrgCulture>2057</OrgCulture>
        <UserLanguage>1033</UserLanguage>
        <UserCulture>2057</UserCulture>
        <OrgID>&#123;CDFCC2A3-B3A6-DD11-B91D-0019BBD31BFC&#125;</OrgID>
        <UserID>&#123;949E5406-5C5A-DE11-A3B5-001E4F336950&#125;</UserID>
        <CRMVersion>4.0.7333.3</CRMVersion>
      </ServerInformation>
    </CrmScriptErrorReport>

    Monday, September 7, 2009 4:47 PM
  • user has already added this site as trusted site and I have also checked security settings on the his browser and it is looking ok as well..

    also check that java script is enable for him as well..
    Tuesday, September 8, 2009 8:12 AM
  • Could you paste your JavaScript OnLoad event handler for investigation?

    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Tuesday, September 8, 2009 11:36 AM
    Moderator
  • Following is script put onload of Email form...script is used to replace responsible contact instead of account for case entity.

    //debugger
    
    // if form type is create
    if (crmForm.FormType == 1)
    {
    
    // check if it contains regarding object selected
    if(crmForm.all.regardingobjectid.DataValue != null)
    { 
    // if yes check if it is case
    if(crmForm.all.regardingobjectid.DataValue[0] !=null)
    {
       // if it is case then select the responsible contact to To Field in Email
        if(crmForm.all.regardingobjectid.DataValue[0].typename == "incident")
       {
           //case Id
           //alert(crmForm.all.regardingobjectid.DataValue[0].id);
           GetResponsibleContactId(crmForm.all.regardingobjectid.DataValue[0].id);
       }
    }
    }
    }
    
    
    
    function GetResponsibleContactId(caseId)  
    {  
    
     var xml = "" +  
     "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +  
     "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +  
     GenerateAuthenticationHeader() +  
     " <soap:Body>" +  
     "    <RetrieveMultiple xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" + 
    "      <query xmlns:q1=\"http://schemas.microsoft.com/crm/2006/Query\" xsi:type=\"q1:QueryExpression\">" + 
    "        <q1:EntityName>incident</q1:EntityName>" + 
    "        <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" + 
    "          <q1:Attributes>" + 
    "            <q1:Attribute>incidentid</q1:Attribute>" + 
    "            <q1:Attribute>responsiblecontactid</q1:Attribute>" + 
    "          </q1:Attributes>" + 
    "        </q1:ColumnSet>" + 
    "        <q1:Distinct>false</q1:Distinct>" + 
    "        <q1:Criteria>" + 
    "          <q1:FilterOperator>And</q1:FilterOperator>" + 
    "          <q1:Conditions>" + 
    "            <q1:Condition>" + 
    "              <q1:AttributeName>incidentid</q1:AttributeName>" + 
    "              <q1:Operator>Equal</q1:Operator>" + 
    "              <q1:Values>" + 
    "                <q1:Value xsi:type=\"xsd:string\">" + caseId+ "</q1:Value>" + 
    "              </q1:Values>" + 
    "            </q1:Condition>" + 
    "          </q1:Conditions>" + 
    "        </q1:Criteria>" + 
    "      </query>" + 
    "    </RetrieveMultiple>" + 
    "  </soap:Body>" + 
    "</soap:Envelope>" + 
    "";
    
    var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
    
    xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
    xmlHttpRequest.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple");
    xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
    xmlHttpRequest.send(xml);
    
    var resultXml = xmlHttpRequest.responseXML;
    
    //alert(resultXml);
    
    
    
    if(resultXml !=null)
    {    
        var contactId= retriveText(resultXml.selectNodes("//BusinessEntity/q1:responsiblecontactid"));      
        if(contactId!="")
        {
              //Create an array to set as the DataValue for the lookup control.     
              var lookupData = new Array(); 
              
             //Create an Object add to the array.     
               var lookupItem= new Object();
          
             //Set the id, typename, and name properties to the object.     
              lookupItem.id = contactId;     
              lookupItem.typename = 'contact';    
    
              var lookupname = retriveName(lookupItem.id);     
     
              lookupItem.name = lookupname;
    
             // Add the object to the array.       
              lookupData[0] = lookupItem; 
                     
            // Set the value of the lookup field to the value of the array.           
              crmForm.all.to.DataValue = lookupData; 
        
          } 
    
     }
    
    }
    
    function retriveText(InputNode)
    {
      var text = "";
    
         if (InputNode !=null)
         {
            //alert(InputNode[0].text);
            if(InputNode[0]!=null)
            {
                text =InputNode[0].text;    
            }
         } 
    
     return text;
    }
    
    
    function retriveName(ContactNodeId)
    {
      var textReturn = "";
    
         if (ContactNodeId !=null)
         {
             var xml = "" +  
     "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +  
     "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +  
     GenerateAuthenticationHeader() +  
     " <soap:Body>" +  
     "    <RetrieveMultiple xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" + 
    "      <query xmlns:q1=\"http://schemas.microsoft.com/crm/2006/Query\" xsi:type=\"q1:QueryExpression\">" + 
    "        <q1:EntityName>contact</q1:EntityName>" + 
    "        <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" + 
    "          <q1:Attributes>" + 
    "            <q1:Attribute>contactid</q1:Attribute>" + 
    "            <q1:Attribute>fullname</q1:Attribute>" + 
    "          </q1:Attributes>" + 
    "        </q1:ColumnSet>" + 
    "        <q1:Distinct>false</q1:Distinct>" + 
    "        <q1:Criteria>" + 
    "          <q1:FilterOperator>And</q1:FilterOperator>" + 
    "          <q1:Conditions>" + 
    "            <q1:Condition>" + 
    "              <q1:AttributeName>contactid</q1:AttributeName>" + 
    "              <q1:Operator>Equal</q1:Operator>" + 
    "              <q1:Values>" + 
    "                <q1:Value xsi:type=\"xsd:string\">" + ContactNodeId + "</q1:Value>" + 
    "              </q1:Values>" + 
    "            </q1:Condition>" + 
    "          </q1:Conditions>" + 
    "        </q1:Criteria>" + 
    "      </query>" + 
    "    </RetrieveMultiple>" + 
    "  </soap:Body>" + 
    "</soap:Envelope>" + 
    "";
    
    var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
    
    xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
    xmlHttpRequest.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple");
    xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
    xmlHttpRequest.send(xml);
    
    var resultXml = xmlHttpRequest.responseXML;
    
    //alert(resultXml);
    
    
    if(resultXml !=null)
    {    
        textReturn= retriveText(resultXml.selectNodes("//BusinessEntity/q1:fullname"));    
    }
    
    } 
    
     return textReturn;
    }
    Tuesday, September 8, 2009 12:10 PM
  • Hi.

    Your code can't cause error you retrieve. Try to clean up cash of your browser (Tools - General - Delete browsing history - Delete Temporary Internet Files in the case of IE 7.0). If this would not help I suggest you to open ticket in Microsoft support.
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Tuesday, September 8, 2009 12:37 PM
    Moderator
  • Hi,

    I am creating an crm email activity from code,  I am using email.torecipients = "usercustomemail@email.com" and user enters emial addresses comma or semi colon seperated in a textbox from custom entity where he wants to send emails.

    Email activity is creating fine in crm, however when i open email in crm it is showing To filed as empty, this post also mention this issue http://blogs.infinite-x.net/2007/04/ , however suggested solution to use activityparty is not applicable in my case as emails do not exist in crm and can be changed from custom entity.

    Any suggestion...


    Kaleemullah Khan
    Tuesday, August 3, 2010 11:57 AM
  • You might get away with just using the AddressUsed attribute of activityparty.
    MSCRM Bing'd - http://bingsoft.wordpress.com
    Tuesday, August 3, 2010 12:09 PM
    Moderator
  • Yes it worked fine using activityparty with addressused filed thanks RhettClinton, I am wondering whats the purpose then for using torecipients. email


    Kaleemullah Khan
    Tuesday, August 3, 2010 2:27 PM