Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

ErrorCode>-2147220970</ErrorCode

Posted on by Microsoft Employee

Hi I'm trying to clone the Sales Order depending dialog input number from User using JavaScript. I had checked logic code in the script which is working for one organization but not working for another organization. I'm getting this error  

4237.e1.png

6303.e2.png

And error look this - 

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #5EEF118ADetail: 
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
  <ActivityId>d74b9a4e-cda7-428c-a0df-7c815a75a249</ActivityId>
  <ErrorCode>-2147220970</ErrorCode>
  <ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic">
    <KeyValuePairOfstringanyType>
      <d2p1:key>CallStack</d2p1:key>
      <d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)</d2p1:value>
    </KeyValuePairOfstringanyType>
  </ErrorDetails>
  <Message>System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #5EEF118A</Message>
  <Timestamp>2017-06-06T22:00:09.4685609Z</Timestamp>
  <ExceptionSource i:nil="true" />
  <InnerFault>
    <ActivityId>d74b9a4e-cda7-428c-a0df-7c815a75a249</ActivityId>
    <ErrorCode>-2147220970</ErrorCode>
    <ErrorDetails xmlns:d3p1="schemas.datacontract.org/.../System.Collections.Generic">
      <KeyValuePairOfstringanyType>
        <d3p1:key>CallStack</d3p1:key>
        <d3p1:value xmlns:d5p1="www.w3.org/.../XMLSchema" i:type="d5p1:string">   at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
   at Microsoft.Crm.Application.Platform.AttributeCollection.CreateValueFromDateTimePropertyValue(String name, Object value, AttributeMetadata attributeMetadata)
   at Microsoft.Crm.Application.Platform.AttributeCollection.SetEntityProperty(Entity entity, String name, String childAttributeName, Object parentProperty, AttributeMetadata attributeMetadata, Object value, IOrganizationContext context)
   at Microsoft.Crm.Application.Platform.AttributeCollection.Insert(String name, Object value, Boolean throwIfKeyExists)
   at Microsoft.Crm.Application.Utility.EntityAttributeMap.ProcessParameters(Entity targetEntity, HashSet`1 keys, NameValueCollection parameters)
   at Microsoft.Crm.Application.Commands.ApplicationCommand.MapEntity(EntityType targetEntityType, NameValueCollection parameters, IMapEntityFactory mapEntityFactory)
   at Microsoft.Crm.Application.InlineEdit.ReadFormDataBuilder.PopulateEntityWithDefaultDataIfAvailable()
   at Microsoft.Crm.Application.InlineEdit.ReadFormDataBuilder.LazyLoadEntity()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at Microsoft.Crm.Application.InlineEdit.ReadFormDataBuilder.WriteFormDataJson(TextWriter writer)
   at Microsoft.Crm.Application.InlineEdit.ReadFormDataBuilder.WriteFormattedEntityData(TextWriter writer, Boolean isTurboForm)
   at Microsoft.Crm.Application.Pages.Form.FormDataPage.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)</d3p1:value>
      </KeyValuePairOfstringanyType>
    </ErrorDetails>
    <Message>System.FormatException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #E1D120A8</Message>
    <Timestamp>2017-06-06T22:00:09.4842035Z</Timestamp>
    <ExceptionSource i:nil="true" />
    <InnerFault i:nil="true" />
    <OriginalException i:nil="true" />
    <TraceText i:nil="true" />
  </InnerFault>
  <OriginalException i:nil="true" />
  <TraceText i:nil="true" />
</OrganizationServiceFault>

When its client side error or server side error?


*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: ErrorCode>-2147220970</ErrorCode

    Would it be something related to the querystring max length limit?

    Microsoft states that the maximum length of a URL in Internet Explorer is 2,083 characters, with no more than 2,048 characters in the path portion of the URL.

    Try to cut down the number of parameters and test again? Otherwise could it be some date format issue?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: ErrorCode>-2147220970</ErrorCode

    Hi Melvin fong ,

    from this UI (HTML)                7026.e3.png

    /WebResources/new_Dialog_Custom_SO

     I'm able to call this callbackfunction in order to pass number from the interface. 

    function DuplicateSO() {

    var DialogProperty = new Xrm.DialogOptions();
    DialogProperty.width = 370;
    DialogProperty.height = 240;

    Xrm.Internal.openDialog("/WebResources/new_Dialog_Custom_SO", DialogProperty, null, null, CallbackFunction);


    function CallbackFunction(oReturn) {

    //get values from the Current Record --> SO
    var SOId = Xrm.Page.data.entity.getId();

    if (Xrm.Page.data.entity.attributes.get("new_customeraccount").getValue() != null) {
    var CustomerId = Xrm.Page.data.entity.attributes.get("new_customeraccount").getValue()[0].id;
    var CustomerName = Xrm.Page.data.entity.attributes.get("new_customeraccount").getValue()[0].name;
    var CustomerType = Xrm.Page.data.entity.attributes.get("new_customeraccount").getValue()[0].entityType;
    }

    if (Xrm.Page.data.entity.attributes.get("new_accountexecutivesalesrep").getValue() != null) {
    var AESPId = Xrm.Page.data.entity.attributes.get("new_accountexecutivesalesrep").getValue()[0].id;
    var AESPName = Xrm.Page.data.entity.attributes.get("new_accountexecutivesalesrep").getValue()[0].name;
    var AESPType = Xrm.Page.data.entity.attributes.get("new_accountexecutivesalesrep").getValue()[0].entityType;
    }

    if (Xrm.Page.data.entity.attributes.get("new_case").getValue() != null) {
    var CaseId = Xrm.Page.data.entity.attributes.get("new_case").getValue()[0].id;
    var CaseName = Xrm.Page.data.entity.attributes.get("new_case").getValue()[0].name;
    var CaseType = Xrm.Page.data.entity.attributes.get("new_case").getValue()[0].entityType;
    }

    var DateofSale = FormatDate("new_dateofsale");


    var DeliveryETA = FormatDate("new_deliveryeta");


    var CustomerNotified = FormatDate("new_customernotified");


    var windowOptions = {
    openInNewWindow: true
    };


    //pop Sale Orders form with default values
    for (var i = 1; i <=oReturn ; i++)
    {
    var Dateoforder = FDate("new_dateoforder" , i);

    //define default values for new Sale Orders record

    var parameters = {};


    if (CustomerId != null && CustomerName != null) {
    parameters["new_customeraccount"] = CustomerId;
    parameters["new_customeraccountname"] = CustomerName;
    }

    if (AESPId != null && AESPName != null) {
    parameters["new_accountexecutivesalesrep"] = AESPId;
    parameters["new_accountexecutivesalesrepname"] = AESPName;
    }

    if (CaseId != null && CaseName != null) {
    parameters["new_case"] = CaseId;
    parameters["new_casename"] = CaseName;
    }

    parameters["new_transactiontype"] = Xrm.Page.data.entity.attributes.get("new_transactiontype").getValue();

    parameters["new_typeofsale"] = Xrm.Page.data.entity.attributes.get("new_typeofsale").getValue();

    parameters["new_duration"] = Xrm.Page.data.entity.attributes.get("new_duration").getValue();

    parameters["new_neworrecurring"] = Xrm.Page.data.entity.attributes.get("new_neworrecurring").getValue();

    parameters["new_ponumber"] = Xrm.Page.data.entity.attributes.get("new_ponumber").getValue();

    parameters["new_description"] = Xrm.Page.data.entity.attributes.get("new_description").getValue();

    parameters["new_saletotal"] = Xrm.Page.data.entity.attributes.get("new_saletotal").getValue();

    parameters["new_customerpo"] = Xrm.Page.data.entity.attributes.get("new_customerpo").getValue();

    parameters["new_salesorderlocation"] = Xrm.Page.data.entity.attributes.get("new_salesorderlocation").getValue();

    parameters["new_grossprofit"] = Xrm.Page.data.entity.attributes.get("new_grossprofit").getValue();


    parameters["statuscode"] = Xrm.Page.data.entity.attributes.get("statuscode").getValue();

    parameters["new_reasonwaiting"] = Xrm.Page.data.entity.attributes.get("new_reasonwaiting").getValue();

    parameters["new_islicense"] = Xrm.Page.data.entity.attributes.get("new_islicense").getValue();

    parameters["new_orderconfirmation"] = Xrm.Page.data.entity.attributes.get("new_orderconfirmation").getValue();

    parameters["new_trackingnumbers"] = Xrm.Page.data.entity.attributes.get("new_trackingnumbers").getValue();


    parameters["new_shippingpriority"] = Xrm.Page.data.entity.attributes.get("new_shippingpriority").getValue();

    parameters["new_shippingcarrier"] = Xrm.Page.data.entity.attributes.get("new_shippingcarrier").getValue();

    parameters["new_shiptoaddress"] = Xrm.Page.data.entity.attributes.get("new_shiptoaddress").getValue();

    parameters["new_rmaneeded"] = Xrm.Page.data.entity.attributes.get("new_rmaneeded").getValue();

    parameters["new_servicerequired"] = Xrm.Page.data.entity.attributes.get("new_servicerequired").getValue();

    parameters["new_hotsheets"] = Xrm.Page.data.entity.attributes.get("new_hotsheets").getValue();

    parameters["new_projecttracking"] = Xrm.Page.data.entity.attributes.get("new_projecttracking").getValue();

    parameters["new_trackingnotes"] = Xrm.Page.data.entity.attributes.get("new_trackingnotes").getValue();

    parameters["new_deliveryeta"] = DeliveryETA;
    parameters["new_customernotified"] = CustomerNotified;
    parameters["new_dateofsale"] = DateofSale;
    parameters["new_dateoforder"] = Dateoforder;

    Xrm.Utility.openEntityForm("new_salestracking", null, parameters, windowOptions);
    }
    }
    }

    // This function takes the fieldname of a date field as input and returns the value of that field in MM/DD/YYYY format
    // Note: the day, month and year variables are numbers
    function FormatDate(fieldname) {
    var d = Xrm.Page.data.entity.attributes.get(fieldname).getValue();
    if (d != null) {
    var curr_date = d.getDate();
    var curr_month = d.getMonth();
    curr_month++; // getMonth() considers Jan month 0, need to add 1
    var curr_year = d.getFullYear();
    return curr_month + "/" + curr_date + "/" + curr_year;
    }
    else return null;
    }

    // This function takes the fieldname of a date field as input and returns the value of that field in MM/DD/YYYY format
    // Based on input number, increment of next month for follow ups

    function FDate(fieldDate, i) {
    var FD = Xrm.Page.getAttribute(fieldDate).getValue();
    if (FD != null) {
    FD = new Date(FD);
    FD.setMonth(FD.getMonth() + i);// getMonth() considers Jan month 0, need to add 1
    var dd = FD.getDate();
    var mm = FD.getMonth() + 1; //January is 0!
    var yyyy = FD.getFullYear();
    var time = FD.getTime();
    var reqDate = mm + '/' + dd + '/' + yyyy;
    return reqDate;
    }
    else return null;
    }

    Its able to open new create record in new tab but I'm getting this error & unable to copy.

    Yes I had debug from the developer tools but its not showing any error or error line related to this source code.

    I agree too its not telling much information from this log file.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: ErrorCode>-2147220970</ErrorCode

    Can you show your code here?

    Don't see much information in the error. Are you able to debug and tell which line is giving problem also?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans