Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Record is unavailable error on click of + button

Posted on by Microsoft Employee

Hi experts,

I have 2 main case forms

I customized the command of the case subgrid + new button to open a case form based on the value selected of  field new_businessunit.

When I click the button, my script is getting triggered but I'm getting the following error:

Screen-Shot-2018_2D00_06_2D00_08-at-11.40.22-AM.png

Here is the log file:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.Crm.CrmException: incident With Id = 6a3fccfa-8415-47d2-a4e2-6a94cda3599c Does Not Exist
   at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()
   at Microsoft.Crm.Application.Platform.ServiceCommands.RetrieveCommand.Execute()
   at Microsoft.Crm.Application.Platform.EntityProxy.Retrieve(String[] columns, Guid auditingTransactionId, Boolean addRequiredColumns)
   at Microsoft.Crm.Application.Platform.EntityProxy.Retrieve(String[] columns, Boolean addRequiredColumns)
   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)
   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.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously): Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #26A02C61Detail: 
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
  <ActivityId>27b07d81-f0c5-4f1c-8bc5-7cf96af80b23</ActivityId>
  <ErrorCode>-2147220970</ErrorCode>
  <ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
  <Message>System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---&gt; Microsoft.Crm.CrmException: incident With Id = 6a3fccfa-8415-47d2-a4e2-6a94cda3599c Does Not Exist
   at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()
   at Microsoft.Crm.Application.Platform.ServiceCommands.RetrieveCommand.Execute()
   at Microsoft.Crm.Application.Platform.EntityProxy.Retrieve(String[] columns, Guid auditingTransactionId, Boolean addRequiredColumns)
   at Microsoft.Crm.Application.Platform.EntityProxy.Retrieve(String[] columns, Boolean addRequiredColumns)
   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)
   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.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously): Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #26A02C61</Message>
  <Timestamp>2018-06-08T06:11:23.1766985Z</Timestamp>
  <ExceptionRetriable>false</ExceptionRetriable>
  <ExceptionSource i:nil="true" />
  <InnerFault>
    <ActivityId>27b07d81-f0c5-4f1c-8bc5-7cf96af80b23</ActivityId>
    <ErrorCode>-2147220969</ErrorCode>
    <ErrorDetails xmlns:d3p1="schemas.datacontract.org/.../System.Collections.Generic" />
    <Message>incident With Id = 6a3fccfa-8415-47d2-a4e2-6a94cda3599c Does Not Exist</Message>
    <Timestamp>2018-06-08T06:11:23.1766985Z</Timestamp>
    <ExceptionRetriable>false</ExceptionRetriable>
    <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>


Thanks,

Jon

*This post is locked for comments

  • Suggested answer
    BharatPremji Profile Picture
    BharatPremji 2,485 on at
    RE: Record is unavailable error on click of + button

    Jon,

    Just saw your using CRM Online, you should be using the Xrm.Navigation.OpenForm:

    docs.microsoft.com/.../openform

    Note there was an error in the Microsoft documentation regarding the formid parameter:

    stackoverflow.com/.../xrm-navigation-openform-not-honouring-formid

    Bharat

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Record is unavailable error on click of + button

    Hi all,

    I tried it one by one and it started to work. I didn't even change anything but it started to work. If I get stuck somewhere, I will reach out again.

    Not sure why Dynamics behaves this way sometimes.

    Thanks for your help!

    Jon

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Record is unavailable error on click of + button

    Hi Jon ,

    Try with this -

    function OpenCase() {
        var parameters = {};
        var windowOptions = {
            openInNewWindow: true
        };
        var formId = Xrm.Page.ui.formSelector.getCurrentItem().getId();
        var unit = Xrm.Page.getAttribute("new_businessunit").getValue();
        var name = Xrm.Page.getAttribute("name").getValue();
        alert(name);
        if (unit == "100000001") {    
            parameters["formid"] = "6a3fccfa-8415-47d2-a4e2-6a94cda3599c";  ///Make Sure your formId is correct
            Xrm.Utility.openEntityForm("incident", null, parameters,windowOptions);
        }
        else {
         
            parameters["formid"] = "4a63c8d1-6c1e-48ec-9db4-3e6c7155334c"; // Make Sure formid is correct   
            Xrm.Utility.openEntityForm("incident", null, parameters,windowOptions);
        }
    }
    


    You can also try without form id .

    
    
  • Verified answer
    BharatPremji Profile Picture
    BharatPremji 2,485 on at
    RE: Record is unavailable error on click of + button

    Hi Jon,

    Try opening the Form without any of the parameters (except formid)

    If that works and opens the correct form, build up the parameters one by one until you hit the error.  I have found that if any of the values you are passing in are NULL it will throw an error.

    Also, try changing the GUID to upper case, see if that makes any difference

    Regards

    Bharat

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Record is unavailable error on click of + button

    Hi Goutam,

    I am passing the form ID in the code:

    function OpenCase() {
    
        var formId = Xrm.Page.ui.formSelector.getCurrentItem().getId();
        var unit = Xrm.Page.getAttribute("new_businessunit").getValue();
        var name = Xrm.Page.getAttribute("name").getValue();
        alert(name);
        if (unit == "100000001") {
            /*var parameters = {
    new_address1_city: Xrm.Page.getAttribute("address1_city").getValue(),
    new_siteaddress: Xrm.Page.getAttribute("address1_composite").getValue(),
    new_orgcode: Xrm.Page.getAttribute("new_orgcode").getValue(),
    new_orglocationcode: Xrm.Page.getAttribute("new_orglocationcode").getValue(),
    new_supportgroupmember: Xrm.Page.getAttribute("new_supportgroupmember").getValue(),
    new_primaryphone: Xrm.Page.getAttribute("telephone1").getValue(),
    };*/
            parameters["formid"] = "6a3fccfa-8415-47d2-a4e2-6a94cda3599c";  //DRB Case Form ID
    
            /*parameters["customerid"] = Xrm.Page.data.entity.getId().replace('{', "").replace("}", "");
            parameters["customeridname"] = Xrm.Page.getAttribute("name").getValue();
            parameters["customeridtype"] = Xrm.Page.data.entity.getEntityName();;*/
    
            Xrm.Utility.openEntityForm("incident", null, parameters);
        }
        else {
            /*var parameters = {
    new_address1_city: Xrm.Page.getAttribute("address1_city").getValue(),
    new_siteaddress: Xrm.Page.getAttribute("address1_composite").getValue(),
    new_orgcode: Xrm.Page.getAttribute("new_orgcode").getValue(),
    new_orglocationcode: Xrm.Page.getAttribute("new_orglocationcode").getValue(),
    new_supportgroupmember: Xrm.Page.getAttribute("new_supportgroupmember").getValue(),
    new_primaryphone: Xrm.Page.getAttribute("telephone1").getValue(),
    };   */
            parameters["formid"] = "4a63c8d1-6c1e-48ec-9db4-3e6c7155334c"; //Unitec Case Form ID
         
            /*parameters["customerid"] = Xrm.Page.data.entity.getId().replace('{', "").replace("}", "");
            parameters["customeridname"] = Xrm.Page.getAttribute("name").getValue();
            parameters["customeridtype"] = Xrm.Page.data.entity.getEntityName();;*/
    
        
            Xrm.Utility.openEntityForm("incident", null, parameters);
        }
    }


    Thanks,

    Jon

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Record is unavailable error on click of + button

    Hi Jon ,

    How do you opening the record ? Seems the GUID you are passing is not available in the database in the Update form.

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans