locked
Publishing the entity gives an error RRS feed

  • Question

  • Hi All,

    I am getting an error when publishing the entity in CRM.I used CRMDiagTool for tracing the error.Once we used this tool this generates a text file.But in this text file i am unable to locate the error information.

    please share me your valuable suggisitions.

    Thanks & Regards,

    Sudhakar

     


    Thanks & Regards, Sudhakar
    Tuesday, October 26, 2010 8:37 PM

Answers

  • I don't believe you are going to be successful creating a Marketing List using Opportunities.  Opportunities are generally associated with Contacts and Accounts.  You should use the related Account or Contact for your Marketing List.

    Regards, Donna

    • Marked as answer by Jim Glass Jr Monday, November 15, 2010 5:20 PM
    Monday, November 15, 2010 4:17 PM

All replies

  • Hi All,

    I am getting error when i published a "opportunity". Why i am getting this error i guess but i don't know how to resolve it.

    The thing is i created the market list from opportunity.Actually in CRM4.0 we can create the Marketing List from Lead, Contact and Account only.But i developed the code creating Marketing List from Opportunity. Here i provided the contact information in opportunity. When you add members to the opportunity member type marketing list, it contains the contact information in it. The code like this,

    Code:

    // Hide member type picklist
    document.getElementById('createdfromcode').style.display = 'none';

    // Hide custom member type picklist label (*)
    document.getElementById('new_membertype_c').style.display = 'none';

    // place custom member type in the right location
    var membertype = document.getElementById('new_membertype');
    document.getElementById('createdfromcode_d').appendChild(membertype);

    // make member type readonly unless for new marketing list
    if(crmForm.FormType != 1 && crmForm.FormType != 5)
      document.getElementById('new_membertype').disabled = true;

    // if member type is "opportunity" customize manage members button
    if(document.getElementById('new_membertype').DataValue != "4")
      return;

    var navElement = document.getElementById('navListMember');
    if (navElement != null)
    {
        navElement.onclick = function LoadAreaOverride()
        {
            // Call the original CRM method to launch the navigation link and create area iFrame
           //loadArea('navListMember');
           loadArea('areaListMember', '\x26createdfromcode\x3d2');

           var Iframe = document.getElementById('areaListMemberFrame');

           if (Iframe != null)
          {
               Iframe.onreadystatechange = function OpenOpportunityLookup()
              {
                  if (Iframe.readyState == 'complete')
                  {
                      var iFrame = frames[window.event.srcElement.id];
                      iFrame.document.getElementById('_MBOpenManageMembersWizard2GUID420425').onclick = function ManageMembersClicked()
                     {
                          var returnValue = window.showModalDialog('/iic/_controls/lookup/lookupmulti.aspx?class=alllookups&objecttypes=3&browse=0&shownewbutton=0',null);
                          if(returnValue != null)
                          {
                              // loop through opportunities

                             var contacts = new Array();

                              for(i=0;i<returnValue.items.length;i++)
                              {
                                  // Prepare variables for a contact to retrieve.
                                  var oppid = returnValue.items[i].id;
                                  var authenticationHeader = GenerateAuthenticationHeader();

                                  // 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'>"+
                                  authenticationHeader+
                                  "<soap:Body>"+
                                  "<Retrieve xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>"+
                                  "<entityName>opportunity</entityName>"+
                                  "<id>"+oppid +"</id>"+
                                  "<columnSet xmlns:q1='http://schemas.microsoft.com/crm/2006/Query' xsi:type='q1:ColumnSet'>"+
                                  "<q1:Attributes>"+
                                  "<q1:Attribute>customerid</q1:Attribute>"+
                                  "</q1:Attributes>"+
                                  "</columnSet>"+
                                  "</Retrieve>"+
                                  "</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/Retrieve");
                                  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;

                                  // Check for errors.
                                  var errorCount = resultXml.selectNodes('//error').length;
                                  if (errorCount != 0)
                                  {
                                       var msg = resultXml.selectSingleNode('//description').nodeTypedValue;
                                       alert(msg);
                                  }
                                  // Display the retrieved value.
                                  else
                                  {
                                      contacts.push(resultXml.selectSingleNode("//q1:customerid").nodeTypedValue);
                                  }
                              }

                             // add contacts to marketing list
                             for(i=0;i<contacts.length;i++)
                             {
                                 //debugger
                                // Prepare variables to add a new product to a campaign.
                                 var MarketingListId = crmForm.ObjectId;
                                 var EntityId = contacts[i];
                                 var authenticationHeader = GenerateAuthenticationHeader();

                                 // 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'>"+
                                 authenticationHeader+
                                 "<soap:Body>"+
                                 "<Execute xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>"+
                                 "<Request xsi:type='AddMemberListRequest '>"+
                                 "<ListId>"+MarketingListId +"</ListId>"+
                                 "<EntityId>"+EntityId+"</EntityId>"+
                                 "</Request>"+
                                 "</Execute>"+
                                 "</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/Execute");
                                 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;

                                 // Check for errors.
                                 var errorCount = resultXml.selectNodes('//error').length;
                                 if (errorCount != 0)
                                 {
                                     var msg = resultXml.selectSingleNode('//description').nodeTypedValue;
                                     alert("One or more opportunities are not added as they don't have associated contact");
                                 }
                             }
                             iFrame.document.getElementById('crmGrid').Refresh();
                             // Display a confirmation message
                             //window.status = contacts.length + " contact(s) added successfully!";
                          }
                      }
                  }
               }
           }
        }
    }

    If anybody check this code then you will know what happend when creating marketing list  from opportunity. This is Ok.

    But my problem is when i do some changes(like adding attributes,deleting attributes ...) on opportunity form it won't Publish and gives an error message like "An error has occured". 

    Actually i import ithis code from another organization.We are using roll up13.we created four organization in one server.

    Please share me your information why this error comes? what is the reason?Is there any rollup's problem or organization problem?

     

    Thanks & Regards,

    Sudhakar.

     


    Thanks & Regards, Sudhakar
    Friday, October 22, 2010 8:52 PM
  •  

    I suggest you enabled platform tracing using Microsoft Crm Diagnostics Tool 4  which you can download here and then publish your customisation

    https://community.dynamics.com/product/crm/crmtechnical/b/crmjimwang/archive/2010/03/08/download-58-crm-4-0-diagnostics-tool-alternative-link.aspx

    This should help you in tracing the issue with publishing the form.

    If you determine your code is causing the publish error then remove all the code from form Onload and slowly include one line or a method at a time. You can then ascertain the code that fails. Also once you complete your coding you should test your changes before publishing.

    Try to debug you code by inserting debugger; statement in the code. As a best practice you should decompose your code into smaller chunks by creating method/ functions where ever possible.


    Check the following link to learn more about debugging in IE

    http://www.jonathanboutelle.com/how-to-debug-javascript-in-internet-explorer


    Hope this helps. Amar
    Friday, October 22, 2010 10:55 PM
  • Hi Reddy,

    Thanks for sharing the valuable information.

     

    Thanks & Regards,

    Sudhakar


    Thanks & Regards, Sudhakar
    Sunday, October 24, 2010 6:57 PM
  • Hi Sudhakar,

    check out following article regarding troubleshotting any CRM issue. this will help you find real cause of the issue.

    http://mayankp.wordpress.com/2010/09/11/dynamic-crm-troubleshooting-methods-for-any-crm-issue/

     


    MayankP
    My Blog
    Follow Me on Twitter
    Monday, October 25, 2010 8:56 AM
  • Sunhakar,

    It's hard to analyze trace logs so I suggest to use Stunware CRM tools: http://www.stunnware.com/default.aspx?area=products&group=swtools4&subarea=swtools4-download and you can filter by category so you can select show me only errors.

    Regarding your problem with publishing entity it's hard to say but often when we have an issue with publishing it happens that during the moving entities from one enviroment to another it was moved also associted entities so relationship will be broken. To check if you have the same issue please open the Form in the Design mode and have a look if any of the fields have a different shading. If it happen you need to remove this field from the Form and publish.

    Try to analyze log files and paste an error here.

    KG


    My Dynamics CRM Blog: http://bovoweb.blogspot.com
    Tuesday, October 26, 2010 9:54 PM
  • Hi Kgorczewski,

    Thanks for sharing the valuable information. According to you i downloaded Stunnware tool and execute the trace file. The following level of errors came.

    Method                                                                           Action                                                                                                

    CrmConfigObjectNotFoundException.....ctor                CrmException:Message:User was not found,ErrorCode:-2147220969

    CrmException......ctor                                                   CrmException:Message:No Microsoft Dynamics CRM user exists with the specified 

                                                                                                                                            domain name  and userID. ErrorCode:-2147220652

    ErrorInformation.LogError                                           MSCRM Error Report

    InProgressCrmService.Execute                                    non-plugin non-CrmException detected - report will be sent to Watson.

    MessageProcessor.Execute                                          Message Processor fail to process message 'Publish' for 'none'.     

     

    Please share me your valuable suggisition for fix these errors.

    I would be very much happy if you gives right direction for fixing the above errors.                       

     


    Thanks & Regards, Sudhakar
    Wednesday, October 27, 2010 8:00 PM
  • there are some issues reported around this.

    Are you accessing CRM using server name?

    Windows credential are not being passed when we use server name.

    try using IP address instead of server name.

     

     


    Jai Ho CRM http://mscrmkb.blogspot.com Skype - amol.gholap

    Mark as answer if a post has answered the question
    Thursday, October 28, 2010 5:00 AM
  • I don't believe you are going to be successful creating a Marketing List using Opportunities.  Opportunities are generally associated with Contacts and Accounts.  You should use the related Account or Contact for your Marketing List.

    Regards, Donna

    • Marked as answer by Jim Glass Jr Monday, November 15, 2010 5:20 PM
    Monday, November 15, 2010 4:17 PM