CRM 2013 Email Router Issue

We configured email router using Office 365 Exchange Online. Followed everything as mentioned in "http://blogs.msdn.com/b/niran_belliappa/archive/2014/04/10/installing-and-configuring-the-e-mail-router-for-exchange-online-and-crm-online.aspx".
Test access is also success. But when I tried to send email from CRM it is not working. The status is still in "Pending Send". Please suggest some solution if you aware of this issue.
Thanks,
Nithya

Thanks for the response. Link was useful.  Now we are able to send mail only using the same account which we have used for Outgoing profile connection. Couldn't Identify what is the issue. PFB screenshots of the configured outgoing profile.

Similar Messages

  • Can CRM 2015 Online use the CRM 2013 Email Router?

    We are trying to plan our upgrade to CRM 2015 Online from CRM 2013 Online. We currently use the CRM 2013 Email Router and want to know if we need to upgrade the email router immediately after the CRM server is upgraded or if we could wait a short period
    of time. I searched but could not find any information on the Email Router compatibility. Does anyone have any information?

    Why are you using the email router if your Exchange Server is also Online?  Dynamics CRM Online has Server Sync built in so it will directly communicate to Exchange Online.  Much better solution than rolling up an email Router. 
    Also, if you don't have access to the Exchange server, I' doubt there's much you can do, since you don't have all the tools you need to troubleshoot the issue.
    The postings on this site are solely my own and do not represent or constitute Hitachi Solutions' positions, views, strategies or opinions.

  • Can CRM 2011 email router process digitally signed emails?

    Hi there,
    Please can you tell em is the CRM 2011 email router is able to process digitally signed emails, as our just seems to ignore them.
    Its annoying as you can track the email manually, but not through the email router at the moment.
    Many thanks
    Stuart
    Stuart

    Hi Bartosz,
    Can i ask if you ever found a way forward with this...?
    I think i have a similar issue with signed emails not being processed.
    Many thanks
    Stuart
    Stuart

  • MS Dynamic CRM server 2013 Email router configuration

     We have installed  CRM 2013 on premises and we need to configure email router to send receive the emails from the CRM. Also we need to integrate the outlook with the CRM 2013.
    Kindly suggest..

    Hi Bartosz,
    Can i ask if you ever found a way forward with this...?
    I think i have a similar issue with signed emails not being processed.
    Many thanks
    Stuart
    Stuart

  • CRM 2013 - Inconsistent javascript issue crash the web client and user needs to reopen

    Hello,
    We are using CRM 2013 on premise version and almost 600 users are using it. We have some inconsistent JavaScript issue (following is the log for same) which happens to users in a day or two. When this issue occurs user can not work in system and they have
    to open new instance of CRM.
    Does anybody knows about this error?
    <CrmScriptErrorReport>
      <ReportVersion>1.0</ReportVersion>
      <ScriptErrorDetails>
       <Message>Unable to get property 'location' of undefined or null reference</Message>
       <Line>1</Line>
       <URL>/_static/_common/scripts/main.js?ver=1676323357</URL>
       <PageURL>/main.aspx#313155368</PageURL>
       <Function>anonymous($p0,$p1,$p2){this.$3_3.get_currentIFrame()&&Mscrm.PerformanceTracing.write("Unload",this.$3_3.get_currentIFrame().src);this.$H_3=$p0.toString();this.$26_3();this.$1A_3();this.$1J_3();if($p0.get_isLocalServer())$p0.get_query()["pagemode"]="iframe</Function>
       <CallStack>
        <Function>anonymous($p0,$p1,$p2){this.$3_3.get_currentIFrame()&&Mscrm.PerformanceTracing.write("Unload",this.$3_3.get_currentIFrame().src);this.$H_3=$p0.toString();this.$26_3();this.$1A_3();this.$1J_3();if($p0.get_isLocalServer())$p0.get_query()["pagemode"]="iframe";addPassiveAuthParameters($p0);var$v_0=$p0.toString();if(IsNull($p2))$p2=false;var$v_1=this.$18_3($p0,$p2);if($v_1){if(this.$2z_3()){window.location.reload();return}this.$2d_3();this.$1s_3();Mscrm.PerformanceTracing.write("Navigate",$v_0);!Mscrm.Utilities.isIE()&&this.raiseEvent(Mscrm.ScriptEvents.UpdateTopLocation,null);this.$3_3.get_currentIFrame().contentWindow.location.replace($v_0)}else{this.$10_3();var$v_2=this.get_contentWindow().Sys.Application.findComponent("crmPageManager");if($v_2){!Mscrm.Utilities.isIE()&&$v_2.raiseEvent(Mscrm.ScriptEvents.UpdateTopLocation,null);var$v_3={};$v_3["sourceUri"]=Mscrm.Utilities.getContentUrl(null);$v_2.raiseEvent(Mscrm.ScriptEvents.IFrameReactivated,$v_3)}}window.self.InnerIFrameSrcChangeTimestamp=(newDate).getTime();this.title=$p1;if(window.LOCID_UI_DIR==="RTL"&&$p0.toString().indexOf("PersonalWall")>=0&&window.UseTabletExperience)this.$3_3.get_currentIFrame().style.position="RELATIVE"}</Function>
       </CallStack>
      </ScriptErrorDetails>
      <ClientInformation>
       <BrowserUserAgent>Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)</BrowserUserAgent>
       <BrowserLanguage>en-US</BrowserLanguage>
       <SystemLanguage>en-US</SystemLanguage>
       <UserLanguage>en-US</UserLanguage>
       <ScreenResolution>1366x768</ScreenResolution>
       <ClientName>Web</ClientName>
       <ClientTime>2015-04-20T15:41:12</ClientTime>
      </ClientInformation>
      <ServerInformation>
        <OrgLanguage>1033</OrgLanguage>
        <OrgCulture>1033</OrgCulture>
        <UserLanguage>1033</UserLanguage>
        <UserCulture>1033</UserCulture>
        <OrgID>{E8BBA7AE-A552-DE11-B475-001E0B4882E2}</OrgID>
        <UserID>{614837CD-448B-DE11-A5E1-005056970D6C}</UserID>
        <CRMVersion>6.1.2.112</CRMVersion>
      </ServerInformation>
    </CrmScriptErrorReport>

    Are you on-premise, or on-line? : It's on-premise
    Can you reproduce it on-demand, or is it sporadic?: It's sporadic
    There is a mention of loading an iFrame in the error, do you have iFrames on the form that generates this error?
    It's not on specific forms, so can't identify that. Yes we have iframes on some forms.
    Does it happen on any/all entity forms, or specific ones?  Do the entity forms have any custom JavaScript on them?
    It's not on specific forms. And yes we have javascript on almost all forms.
    Do you have any network problems or slowness in your network? Does the problem happen when the network is busy?
    We need to check this on next occurrence.
    Do the users that see this error have any unusual add-ins or toolbars in their browser?  This is not for specific user. Its happening for all randomly.
    Have you tried other browsers like Chrome or FireFox and do users see the problem there as well?
    We need to check only for IE.

  • Import Fail crm 2011 to crm 2013 Legacy component issue

    Hi All
    We are getting issues during organization import from crm 2011 to crm 2013 , the error is 
    "We have detected the presence of legacy component(s) during upgrade, these components are not supported in Dynamics CRM 2013. Please refer to upgrade log file C:\Users\Administrator\AppData\Roaming\Microsoft\MSCRM\Logs\LegacyFeatureCheck.xml
    for more information."
    when we check log file it shows the error "ISV folder under CRM Website contains one or more files"
    Even we removed everything from ISV folder , Iframe urls from app , solution which is using ISV urls ,plugins and custom workflows but still the error is same
    Please help to resolve this issue .
    Thank you
    Sharique

    Hi,
    Please refer below blog having details about "Removal of the 2007 Endpoint and Legacy Features"
    http://blog.simonjackson.info/2013/07/whats-changing-in-crm-2013-from-sdk.html
    The following legacy Microsoft Dynamics CRM 4.0 features will be removed or will no longer be supported in the next major product release:
    ISV folder support for custom web applications
    Microsoft Dynamics CRM 4.0 plug-ins
    Microsoft Dynamics CRM 4.0 client-side scripting
    Microsoft Dynamics CRM 4.0 custom workflow activities
    Also you can download a tool that can detect legacy feature on your server
    http://go.microsoft.com/fwlink/p/?LinkID=309565
    Entire documentation is available at below article.
    http://msdn.microsoft.com/en-us/library/dn281891.aspx
    Hope this helps.
    Ajay Chawla

  • Sharepoint 2013 email address issue

    Hello,
    I receive the following error when I create Alert for a ask on sharepoint 2013. While there is email attached to the profile on Active Directory.
    "You do not have an e-mail address. 
    Alert has been created successfully but you will not receive notifications until valid e-mail or mobile address has been provided in your profile."
    Thanks

    Hi,
    According to your post, my understanding is that you got an issue when using alert in SharePoint.
    The is caused by the email address it is not updated to the user profile.
    To fix the issue, please sync up the user profile. The solution can be found from:
    http://blogs.technet.com/b/paulpaa/archive/2009/10/01/user-profile-information-not-updated-on-site-collection-s-people-and-group.aspx
    You can also double check the steps while creating the user profile service, there is an article for your reference.
    http://sharepointgeorge.com/2010/configuring-the-user-profile-service-in-sharepoint-2010/
    Make sure the App pool accounts having the right permission.
    What’s more, you can also check the ULS log to see if anything unexpected occurred.
    For SharePoint 2013, by default, ULS log is at
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS
    There is a similar thread for your reference.
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/4a986138-e839-4f92-a5db-a84884fd3588/you-do-not-have-an-email-address?forum=sharepointadminprevious
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Dynamic CRM 2013 Online how to execute Report, generate PDF and email

    Dear All,
    I am using Dynamic CRM 2013 online. For quote, I have workflow and Dialogue processes for review process. On approval, I want the system to generate a PDF of quote report, attach the PDF and email it to the Customer.
    Better I would like, When approver, clicks on the approve button, the system should auto generate a PDF of quote report, attach the PDF and email it to the Customer, without any further input from the user. If its not possible, I may have to put button on
    quote form.
    I am using the attached code, but facing various issues.
    1. Under prepare the SOAP Message coding part, I am not sure what should be the below URL for CRM 2013 Online?
    xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
    2. What should be the emailid here? Is it Recepient Contact id(Guid) ?
    var emailid = resultXml.selectSingleNode("//CreateResult").nodeTypedValue;
    alert("emailid" + emailid.toString());
    3. Using this code, not able to create Entity for "ActivityMimeAttachment", I am getting newEntity as undefined.
    Below is the code I am using. Please check and help me out, where I am going wrong. Let me know if any better way to implement it. At present, I have put one button on quote form, on click event, below code will get executed.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>
    <script type="text/javascript">
    var Xrm;
    if (window.opener) { Xrm = window.opener.Xrm; }
    else if (window.parent) { Xrm = window.parent.Xrm; }
    function getReportingSession() {
    var reportName = "Quotation_Report"; //set this to the report you are trying to download
    var reportId = "7C39D18F-1DC6-E311-8986-D89D6765B238"; //set this to the guid of the report you are trying to download
    var recordid = Xrm.Page.data.entity.getId();
    // recordid = recordid.substring(1, 37); //getting rid of curly brackets
    alert(recordid);
    var pth = Xrm.Page.context.getServerUrl() + "/CRMReports/rsviewer/reportviewer.aspx";
    var retrieveEntityReq = new XMLHttpRequest();
    retrieveEntityReq.open("POST", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    retrieveEntityReq.send("id=%7B" + reportId + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName=" + reportName + "&isScheduledReport=false");
    var x = retrieveEntityReq.responseText.indexOf("ReportSession=");
    var ret = new Array();
    ret[0] = retrieveEntityReq.responseText.substr(x + 14, retrieveEntityReq.responseText.indexOf("&", x) - x - 14); //the session id
    x = retrieveEntityReq.responseText.indexOf("ControlID=");
    ret[1] = retrieveEntityReq.responseText.substr(x + 10, retrieveEntityReq.responseText.indexOf("&", x) - x - 10); //the control id
    return ret;
    function createEntity(ent, entName, upd) {
    var jsonEntity = JSON.stringify(ent);
    var createEntityReq = new XMLHttpRequest();
    var ODataPath = Xrm.Page.context.getServerUrl() + "XRMServices/2011/OrganizationData.svc";
    createEntityReq.open("POST", ODataPath + "/" + entName + "Set" + upd, false);
    createEntityReq.setRequestHeader("Accept", "application/json");
    createEntityReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    createEntityReq.send(jsonEntity);
    var newEntity = JSON.parse(createEntityReq.responseText).d;
    alert("new entity" + newEntity);
    return newEntity;
    function createAttachment() {
    var params = getReportingSession();
    var recordid = Xrm.Page.data.entity.getId();
    alert("recordid " + recordid);
    var orgName = Xrm.Page.context.getOrgUniqueName();
    var userID = Xrm.Page.context.getUserId();
    //create email record
    // Prepare the SOAP message.
    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'>" +
    "<soap:Header>" +
    "</soap:Header>" +
    "<soap:Body>" +
    "<Create xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>" +
    "<entity xsi:type='email'>" +
    "<regardingobjectid type='quote'>" + recordid + "</regardingobjectid>" +
    "<subject>" + "Email with Attachment4" + "</subject>" +
    "</entity>" +
    "</Create>" +
    "</soap:Body>" +
    "</soap:Envelope>";
    // Prepare the xmlHttpObject and send the request.
    var xHReq = new ActiveXObject("Msxml2.XMLHTTP");
    xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
    xHReq.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/crm/2007/WebServices/Create");
    xHReq.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    xHReq.setRequestHeader("Content-Length", xml.length);
    xHReq.send(xml);
    // Capture the result
    var resultXml = xHReq.responseXML;
    // alert("resultXml " + resultXml);
    // Check for errors.
    var errorCount = resultXml.selectNodes('//error').length;
    if (errorCount != 0) {
    alert("ERROR");
    var msg = resultXml.selectSingleNode('//description').nodeTypedValue;
    alert(msg);
    var emailid = resultXml.selectSingleNode("//CreateResult").nodeTypedValue;
    alert("emailid" + emailid.toString());
    //var emailid = userID;
    var post = Object();
    post.Body = encodePdf(params);
    var email = new Array();
    email[0] =new Object();
    email[0].id = emailid;
    email[0].entityType ='email';
    post.Subject ="File Attachment";
    post.AttachmentNumber = 1;
    post.FileName ="Report.pdf";
    post.MimeType ="application/pdf";
    post.ObjectId = Object();
    post.ObjectId.LogicalName ="email";
    post.ObjectId.Id = email[0].id;
    post.ObjectTypeCode ="email";
    alert(post.ObjectId.Id);
    createEntity(post,"ActivityMimeAttachment", "");
    alert("created successfully");
    email.Subject = "Your Order";
    //Set The current order as the Regarding object
    email.RegardingObjectId = {
    Id: Xrm.Page.data.entity.getId(), //Get the current entity Id , here OrderId
    LogicalName: Xrm.Page.data.entity.getEntityName()//Get the current entity name, here it will be “salesOrder”
    //Create Email Activity
    SDK.JScriptRESTDataOperations.Create(email, "Email", EmailCallBack, function (error) { alert(error.message); });
    // Email Call Back function
    function EmailCallBack(result) {
    email = result; // Set the email to result to use it later in email attachment for retrieving activity Id
    var activityPartyFrom = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyFrom.PartyId = {
    Id: customerId, // id of entity you want to associate this activity with.
    LogicalName: "contact"
    // Set the "activity" of the ActivityParty
    activityPartyFrom.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity).
    activityPartyFrom.ParticipationTypeMask = { Value: 2 }; // 2 means ToRecipients
    // Create the from ActivityParty for the email
    SDK.JScriptRESTDataOperations.Create(activityPartyFrom, "ActivityParty", ActivityPartyFromCallBack, function (error) { alert(error.message); });
    var activityPartyTo = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyTo.PartyId = {
    Id: ownerId, // id of entity you want to associate this activity with.
    LogicalName: "systemuser"
    // Set the "activity" of the ActivityParty
    activityPartyTo.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity). activityPartyTo.ParticipationTypeMask = { Value: 1 }; // 1 means Sender
    // Create the from ActivityParty
    SDK.JScriptRESTDataOperations.Create(activityPartyTo, "ActivityParty", ActivityPartyToCallBack, function (error) { alert(error.message); });
    //ActivityParty From Callback
    function ActivityPartyFromCallBack(result) {
    //ActivityParty To Callback
    function ActivityPartyToCallBack(result) {
    var StringMaker = function () {
    this.parts = [];
    this.length = 0;
    this.append = function (s) {
    this.parts.push(s);
    this.length += s.length;
    this.prepend = function (s) {
    this.parts.unshift(s);
    this.length += s.length;
    this.toString = function () {
    return this.parts.join('');
    var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    function encode64(input) {
    var output = new StringMaker();
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0;
    while (i < input.length) {
    chr1 = input[i++];
    chr2 = input[i++];
    chr3 = input[i++];
    enc1 = chr1 >> 2;
    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
    enc4 = chr3 & 63;
    if (isNaN(chr2)) {
    enc3 = enc4 = 64;
    else if (isNaN(chr3)) {
    enc4 = 64;
    output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
    return output.toString();
    var bdy = new Array();
    var bdyLen = 0;
    function concat2Bdy(x) {
    bdy[bdyLen] = x;
    bdyLen++;
    function encodePdf(params) {
    bdy = new Array();
    bdyLen = 0;
    var retrieveEntityReq = new XMLHttpRequest();
    var pth = Xrm.Page.context.getServerUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] + "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] + "&OpType=Export&FileName=Public&ContentDisposition=OnlyHtmlInline&Format=PDF";
    retrieveEntityReq.open("GET", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.send();
    BinaryToArray(retrieveEntityReq.responseBody);
    return encode64(bdy);
    </SCRIPT>
    <SCRIPT type=text/vbscript>
    Function BinaryToArray(Binary)
    Dim i
    ReDim byteArray(LenB(Binary))
    For i = 1 To LenB(Binary)
    byteArray(i-1) = AscB(MidB(Binary, i, 1))
    concat2Bdy(AscB(MidB(Binary, i, 1)))
    Next
    BinaryToArray = byteArray
    End Function
    </SCRIPT>
    </head>
    <body>
    <input type="button" onclick="createAttachment();" value="Attach Report" />
    </body>
    </html>
    Thanks. and waiting for your valuable comments.
    - Mittal

    Hello,
    Yes, I was able to make my code working as below. Tested on CRM online 2013.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
    <script type="text/javascript">
    if (typeof (SDK) == "undefined")
    { SDK = { __namespace: true }; }
    SDK.JScriptRESTDataOperations = {
    _context: function () {
    if (typeof GetGlobalContext != "undefined")
    { return GetGlobalContext(); }
    else {
    if (typeof Xrm != "undefined") {
    return Xrm.Page.context;
    else { return new Error("Context is not available."); }
    _getServerUrl: function () {
    var serverUrl = this._context().getServerUrl()
    if (serverUrl.match(/\/$/)) {
    serverUrl = serverUrl.substring(0, serverUrl.length - 1);
    return serverUrl;
    _ODataPath: function () {
    return this._getServerUrl() + "/XRMServices/2011/OrganizationData.svc/";
    _errorHandler: function (req) {
    return new Error("Error : " +
    req.status + ": " +
    req.statusText + ": " +
    JSON.parse(req.responseText).error.message.value);
    _dateReviver: function (key, value) {
    var a;
    if (typeof value === 'string') {
    a = /Date\(([-+]?\d+)\)/.exec(value);
    if (a) {
    return new Date(parseInt(value.replace("/Date(", "").replace(")/", ""), 10));
    return value;
    Create: function (object, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("POST", this._ODataPath() + type + "Set", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 201) {
    successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send(JSON.stringify(object));
    Retrieve: function (id, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("GET", this._ODataPath() + type + "Set(guid'" + id + "')", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 200) {
    successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send();
    Update: function (id, object, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("X-HTTP-Method", "MERGE");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 204 || this.status == 1223) {
    successCallback();
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send(JSON.stringify(object));
    Delete: function (id, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("X-HTTP-Method", "DELETE");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 204 || this.status == 1223) {
    successCallback();
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send();
    RetrieveMultiple: function (type, filter, successCallback, errorCallback) {
    if (filter != null) {
    filter = "?" + filter;
    else { filter = ""; }
    var req = new XMLHttpRequest();
    req.open("GET", this._ODataPath() + type + "Set" + filter, true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 200) {
    successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d.results);
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send();
    __namespace: true
    </script>
    <script type="text/javascript">
    //Create Email and link it with Order as Regarding field
    var Xrm;
    var email = new Object();
    var ownerID = "";
    var CustomerId = "";
    if (window.opener) { Xrm = window.opener.Xrm; }
    else if (window.parent) { Xrm = window.parent.Xrm; }
    //Get ownerid who send email of quotation to customer
    function GetOwnerID() {
    var owner = Xrm.Page.getAttribute("ownerid").getValue();
    ownerID = owner[0].id;
    var ownerName = owner[0].name;
    var entityType = owner[0].entityType;
    GetToEmailGUID();
    //Get customerid who receive email of quotation from owner
    function GetToEmailGUID() {
    var Customer = Xrm.Page.getAttribute('customerid').getValue();
    CustomerId = Customer[0].id;
    var CustomerName = Customer[0].name;
    var entityType = Customer[0].entityType;
    //if CustomerId is type of "Account" then get Primary Contact id of that account
    if (entityType == "account") {
    var contact = Xrm.Page.getAttribute("customerid").getValue();
    if (contact === null) return;
    var serverUrl = Xrm.Page.context.getClientUrl();
    var oDataSelect = serverUrl + "/XRMServices/2011/OrganizationData.svc/AccountSet(guid'" + contact[0].id + "')?$select=PrimaryContactId";
    var req = new XMLHttpRequest();
    req.open("GET", oDataSelect, false);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json;charset=utf-8");
    req.onreadystatechange = function () {
    if (req.readyState === 4) {
    if (req.status === 200) {
    var retrieved = JSON.parse(req.responseText).d;
    CustomerId = retrieved.PrimaryContactId.Id;
    else {
    alert(this.statusText);
    req.send();
    function CreateEmail() {
    GetOwnerID();
    email.Subject = "Email with Report Attachment";
    //Set The current order as the Regarding object
    email.RegardingObjectId = {
    Id: Xrm.Page.data.entity.getId(), //Get the current entity Id , here OrderId
    LogicalName: Xrm.Page.data.entity.getEntityName()//Get the current entity name, here it will be “salesOrder”
    //Create Email Activity
    SDK.JScriptRESTDataOperations.Create(email, "Email", EmailCallBack, function (error) { alert(error.message); });
    // Email Call Back function
    function EmailCallBack(result) {
    email = result; // Set the email to result to use it later in email attachment for retrieving activity Id
    var activityPartyFrom = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyFrom.PartyId = {
    Id: CustomerId, //"79EBDD26-FDBE-E311-8986-D89D6765B238", // id of entity you want to associate this activity with.
    LogicalName: "contact"
    // Set the "activity" of the ActivityParty
    activityPartyFrom.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity).
    activityPartyFrom.ParticipationTypeMask = { Value: 2 }; // 2 means ToRecipients
    // Create the from ActivityParty for the email
    SDK.JScriptRESTDataOperations.Create(activityPartyFrom, "ActivityParty", ActivityPartyFromCallBack, function (error) { alert(error.message); });
    var activityPartyTo = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyTo.PartyId = {
    Id: ownerID, //"79EBDD26-FDBE-E311-8986-D89D6765B238", // id of entity you want to associate this activity with.
    LogicalName: "systemuser"
    // Set the "activity" of the ActivityParty
    activityPartyTo.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity).
    activityPartyTo.ParticipationTypeMask = { Value: 1 }; // 1 means Sender
    // Create the from ActivityParty
    SDK.JScriptRESTDataOperations.Create(activityPartyTo, "ActivityParty", ActivityPartyToCallBack, function (error) { alert(error.message); });
    //ActivityParty From Callback
    function ActivityPartyFromCallBack(result) {
    //ActivityParty To Callback
    function ActivityPartyToCallBack(result) {
    GetReportId('Quotation');
    //Create attachment for the created email
    function CreateEmailAttachment() {
    //get reporting session and use the params to convert a report in PDF
    var params = getReportingSession();
    //Email attachment parameters
    var activitymimeattachment = Object();
    activitymimeattachment.ObjectId = Object();
    activitymimeattachment.ObjectId.LogicalName = "email";
    activitymimeattachment.ObjectId.Id = email.ActivityId;
    activitymimeattachment.ObjectTypeCode = "email",
    activitymimeattachment.Subject = "File Attachment";
    activitymimeattachment.Body = encodePdf(params);
    activitymimeattachment.FileName = "Report.pdf";
    activitymimeattachment.MimeType = "application/pdf";
    //Attachment call
    SDK.JScriptRESTDataOperations.Create(activitymimeattachment, "ActivityMimeAttachment", ActivityMimeAttachmentCallBack, function (error) { alert(error.message); });
    //ActivityMimeAttachment CallBack function
    function ActivityMimeAttachmentCallBack(result) {
    var features = "location=no,menubar=no,status=no,toolbar=no,resizable=yes";
    var width = "800px";
    var height = "600px";
    window.open(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", features);
    // To open window which works in outlook and IE both
    //openStdWin(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", width, height, features);
    //This method will get the reportId based on a report name that will be used in getReportingSession() function
    function GetReportId(reportName) {
    var oDataSetName = "ReportSet";
    var columns = "ReportId";
    var filter = "Name eq '" + reportName + "'";
    retrieveMultiple(oDataSetName, columns, filter, onSuccess);
    function retrieveMultiple(odataSetName, select, filter, successCallback) {
    var serverUrl = Xrm.Page.context.getServerUrl();
    var ODATA_ENDPOINT = "/XRMServices/2011/OrganizationData.svc";
    var odataUri = serverUrl + ODATA_ENDPOINT + "/" + odataSetName + "?";
    if (select) {
    odataUri += "$select=" + select + "&";
    if (filter) {
    odataUri += "$filter=" + filter;
    $.ajax({
    type: "GET",
    contentType: "application/json; charset=utf-8",
    datatype: "json",
    url: odataUri,
    beforeSend: function (XMLHttpRequest) {
    XMLHttpRequest.setRequestHeader("Accept", "application/json");
    success: function (data) {
    if (successCallback) {
    if (data && data.d && data.d.results) {
    successCallback(data.d.results);
    else if (data && data.d) {
    successCallback(data.d);
    else {
    successCallback(data);
    error: function (XmlHttpRequest, errorThrown) {
    if (XmlHttpRequest && XmlHttpRequest.responseText) {
    alert("Error while retrieval ; Error – " + XmlHttpRequest.responseText);
    function onSuccess(data) {
    reportId = data[0].ReportId.replace('{', ").replace('}', ");
    CreateEmailAttachment(); // Create Email Attachment
    //Gets the report contents
    function getReportingSession() {
    var pth = Xrm.Page.context.getServerUrl() + "/CRMReports/rsviewer/reportviewer.aspx";
    var retrieveEntityReq = new XMLHttpRequest();
    var Id = Xrm.Page.data.entity.getId();
    var quotationGUID = Id.replace('{', ""); //set this to selected quotation GUID
    quotationGUID = quotationGUID.replace('}', "");
    var reportName = "Quotation"; //set this to the report you are trying to download
    var reportID = "7C39D18F-1DC6-E311-8986-D89D6765B238"; //set this to the guid of the report you are trying to download
    var rptPathString = ""; //set this to the CRMF_Filtered parameter
    var strParameterXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'><entity name='quote'><all-attributes /><filter type='and'><condition attribute='quoteid' operator='eq' uitype='quote' value='" + quotationGUID + "' /> </filter></entity></fetch>";
    retrieveEntityReq.open("POST", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    rptPathString = "id=%7B" + reportID + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName=" +
    reportName + "&isScheduledReport=false&p:CRMAF_Filteredquote=" + strParameterXML;
    //remove the part starting from &p:salesorderid if your report has no parameters
    retrieveEntityReq.send(rptPathString);
    var x = retrieveEntityReq.responseText.indexOf("ReportSession=");
    var ret = new Array();
    ret[0] = retrieveEntityReq.responseText.substr(x + 14, retrieveEntityReq.responseText.indexOf("&", x) - x - 14); //the session id
    x = retrieveEntityReq.responseText.indexOf("ControlID=");
    ret[1] = retrieveEntityReq.responseText.substr(x + 10, retrieveEntityReq.responseText.indexOf("&", x) - x - 10); //the control id
    return ret;
    var bdy = new Array();
    var bdyLen = 0;
    function concat2Bdy(x) {
    bdy[bdyLen] = x;
    bdyLen++;
    function encodePdf(params) {
    bdy = new Array();
    bdyLen = 0;
    var retrieveEntityReq = new XMLHttpRequest();
    var pth = Xrm.Page.context.getServerUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] +
    "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] +
    "&OpType=Export&FileName=Public&ContentDisposition=OnlyHtmlInline&Format=PDF";
    retrieveEntityReq.open("GET", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.send();
    BinaryToArray(retrieveEntityReq.responseBody);
    return encode64(bdy);
    var StringMaker = function () {
    this.parts = [];
    this.length = 0;
    this.append = function (s) {
    this.parts.push(s);
    this.length += s.length;
    this.prepend = function (s) {
    this.parts.unshift(s);
    this.length += s.length;
    this.toString = function () {
    return this.parts.join('');
    var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    function encode64(input) {
    var output = new StringMaker();
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0;
    while (i < input.length) {
    chr1 = input[i++];
    chr2 = input[i++];
    chr3 = input[i++];
    enc1 = chr1 >> 2;
    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
    enc4 = chr3 & 63;
    if (isNaN(chr2)) {
    enc3 = enc4 = 64;
    } else if (isNaN(chr3)) {
    enc4 = 64;
    output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
    return output.toString();
    </script>
    <script type="text/vbscript">
    Function BinaryToArray(Binary)
    Dim i
    ReDim byteArray(LenB(Binary))
    For i = 1 To LenB(Binary)
    byteArray(i-1) = AscB(MidB(Binary, i, 1))
    concat2Bdy(AscB(MidB(Binary, i, 1)))
    Next
    BinaryToArray = byteArray
    End Function
    </script>
    </head>
    <body>
    <input type="button" onclick="CreateEmail();" value="Attach Report" />
    </body>
    </html>
    Thank you,
    Mittal.

  • Error in "APPROVE EMAIL" of Users in CRM 2013.

    Hi, 
    I have created users in my OOTB On-premise organization of MS CRM 2013. Getting below error while approving email of Users:
    There are encrypted fields in the organization database, but the data encryption feature isn't activated. Contact your Microsoft Dynamics CRM system administrator to activate data encryption. To activate, go to Systems Settings > Data Management > Data
    Encryption. For more information, see http://go.microsoft.com/fwlink/?LinkId=316366
    I tried to activate Data Encryption from Data Management(as mentioned in this error), then getting below error:
    Error
    The HTTPS protocol is required for this type of request. Enable the HTTPS protocol and try again. For more information, see the Post-Installation and Configuration instructions.
    Please help.
    Thanks.
    Regards, Devendra V.

    Please refer to this post from Magnetism,
    http://www.magnetismsolutions.com/blog/paulnieuwelaar/2014/10/08/data-encryption-errors-after-restoring-microsoft-dynamics-crm-database
    It definitely resolves the issue.

  • What is the best way for email processing setup on CRM 2013 (on- premises) Set up?

    We need to notify customers via CRM 2013 for some activities.
    I searched regarding email processing set up, and i found two options:
    1. via outlook
    2.  Via Exchange Server.
    Tried through email router (exchange server), but it requires exchange online or SMTP for outgoing profile.
    I  do have exchange on premise setup, I am not sure about SMTP option.
    My queries are:
    > Can we configure Exchange server to work as Exchange Online?
    > what other option, I can try for email Processing?
    looking for your suggestions...
    Thanks in advance!

    If you have Exchange onPremise, then you should be able to use the email router or server side sync in combination with CRM workflows (to generate the email).  This is a fairly common scenario.  You do not need Exchange Online. 
    http://technet.microsoft.com/en-us/library/dn531109(v=crm.6).aspx
    http://technet.microsoft.com/en-us/library/dn531050(v=crm.6).aspx
    http://www.microsoft.com/en-us/download/details.aspx?id=40342
    Regards, Donna

  • Does CRM email router support digitally signed emails?

    Hello There,
    I have configured email router in a one of our test environment to check, i am able to trace incoming mails which has digital signed mails get tracked in CRM. 
    Does CRM email router support digitally signed emails? 
    i am not able to trace mails in to CRM,, have you ever faced this ???? kindly suggest i need this to figure this out.
    Thanks,
    Vinay Kumar.
    Vinay Kumar.

    Thanks Vinay, glad you got it working. We were having some issues and its related to the level of rollup and whether certain headers are allowed through exchange or not.
    However MS's answer is that it does not work.
    Confusing eh.
    CHeers
    Stuart
    Stuart

  • CRM 2013 - Internal query related to fetching top 51 emails

    Hello All,
    We have recently upgraded from CRM 4 to CRM 2013. We are monitoring database server performance through one of the tool. We find that following internal query getting executed more frequently during initial business hours.
    (@ModifiedOn0 datetime,@PartyId0 uniqueidentifier)
    SELECT DISTINCT top 51 "email0".ModifiedOn as "modifiedon" ,  "email0".MessageId as "messageid" ,  "email0".ActivityId as "activityid" ,  "email0".RegardingObjectId
    as "regardingobjectid" ,  "email0".Subject as "subject" ,  "email0".RegardingObjectIdYomiName as "regardingobjectidyominame" ,     "email0".RegardingObjectIdName
    as "regardingobjectidname" ,     "email0".RegardingObjectTypeCode as "regardingobjecttypecode" 
    FROM Email as "email0"  JOIN ActivityParty as "activityparty1"  ON ("email0".ActivityId = "activityparty1".ActivityId 
    AND (("activityparty1".PartyId = @PartyId0))) 
    WHERE (( "email0".ModifiedOn >= @ModifiedOn0 
    AND "email0".MessageId is not null)) 
    ORDER BY "email0".MessageId asc , 
       "email0".ActivityId asc
    I found following useful blog which mentions the reason of frequent execution of this query.
    https://community.dynamics.com/crm/b/dynamicscrmsupportblog/archive/2012/10/11/crm-e-mail-tracking-part-3-tagging.aspx
    My question is,
    1) What will be impact if we disable email tagging option from all users? Note that, We are not using email router in our implementation.
    2) Will this query executes frequently during normal business hours also? If yes, then do we have any settings to change interval of execution of this process? 

    Hi ,
    Try to deactivate the Automatic E-Mail Tagging from Diagnostic Tool and observer the behaviour.
    If it still trigger then better to look for other areas.
    Regards
    Ayaz

  • Outgoing emails on CRM 2013 Online

    I've set up two outgoing server profiles. One for GMAIL and one for Exchange Online. I am currently using trials of both.
    I set the mailboxes of queues to use the correct profiles and to use server-side sync or email router for both incoming and outgoing.
    For both accounts (one using Exchange profile  other using GMAIL), the mailbox tests succeed. The queues also pull in emails. Bot for both, emails I send just sit in Pending Send saying the msg has not yet been submitted for delivery.
    Is there a limitation for trial instances with regard to outgoing email?

    Using Gmail with Microsoft Dynamics CRM 2013
    Link: https://www.youtube.com/watch?v=uH3H-vfauZU

  • Save and Close button issue in CRM 2013 for Activity Type Appointment

    Hi All,
    Have come across a strange behavior in CRM 2013 and would like  to be sure that it really is an issue which others have encountered too.
    Open a Case record, and click on Activity navigation link to see the Open Activity Associated View. Then try creating an Activity of type Meeting and click on
    Save & Close button (not just Save). When you refresh the view, the activity might show up. But repeat the same steps and create another Activity of Type Meeting and this activity will not show up. It doesnt show up even in the All Activities
    view. Seems like the activity does not get created when using Save and Close button.
    This behavior is replicated even on online 30 day trial version. Any inputs?
    Regards,
    Yogesh

    The problem only occurs when your appointment times clash.   "Save and close" just throws the appointment away.  "Save" tells you about clash (or perhaps it's just unavailability) and allows you to ignore and continue with the
    save.

  • Issue with retrieveing the Manager of a System User in a Custom workflow - CRM 2013

    Issues with custom workflow activity in CRM 2013 On-prem
    I'm trying to pass the Manager of the System
    here is the code that I'm running, it gets to setting the MANAGER and stops
    I put the ran the FetchXML seperatly and it does return a value so I know what bit works
    public class CaseAccountManagerManagersLookup : CodeActivity
    // Inputs
    [Input("Enter Case")]
    [ReferenceTarget("incident")]
    public InArgument<EntityReference> CA { get; set; }
    // Outputs
    [Output("Manager Output")]
    [ReferenceTarget("systemuser")]
    public OutArgument<EntityReference> AMOUT { get; set; }
    protected override void Execute(CodeActivityContext executionContext)
    // Context
    IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
    IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
    IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
    //Create the tracing service
    ITracingService tracingService = executionContext.GetExtension<ITracingService>();
    // get the account and renewals manager ID's
    var CASE = CA.Get<EntityReference>(executionContext);
    tracingService.Trace("Case ID = " + CASE.Id);
    try
    // FETCH
    string fetchXml = string.Format(@"
    <fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
    <entity name='incident'>
    <attribute name='title' />
    <attribute name='incidentid' />
    <order attribute='title' descending='false' />
    <filter type='and'>
    <condition attribute='incidentid' operator='eq' value='{0}' />
    </filter>
    <link-entity name='contact' from='contactid' to='customerid' alias='ak'>
    <link-entity name='account' from='accountid' to='parentcustomerid' alias='al'>
    <link-entity name='systemuser' from='systemuserid' to='bc_dssalesperson' alias='am'>
    <attribute name='parentsystemuserid' />
    </link-entity>
    </link-entity>
    </link-entity>
    </entity>
    </fetch>", CASE.Id);
    EntityCollection case_results = service.RetrieveMultiple(new FetchExpression(fetchXml));
    //tracingService.Trace("fetch has run");
    if (case_results.Entities.Count != 0)
    foreach (var a in case_results.Entities)
    //if (a.Attributes.Contains("ai_parentsystemuserid"))
    tracingService.Trace("set manager id next");
    var MANAGERID = (EntityReference)a.Attributes["parentsystemuserid"];
    tracingService.Trace("manager id set");
    AMOUT.Set(executionContext, MANAGERID);
    throw new InvalidOperationException("Want to see trace");
    tracingService.Trace("end ");
    catch (Exception e)
    throw new InvalidPluginExecutionException("Plugin - CaseAccountManagerManagerLookup - " + e.Message);
    finally
    throw new InvalidOperationException("Want to see trace");
    Pete

    Hello,
    Try to use am.parentsystemuserid instead of just parentsystemuserid.
    Dynamics CRM MVP/ Technical Evangelist at
    SlickData LLC
    My blog

Maybe you are looking for