Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Calling Xrm.Utility.openEntityForm throws "Record Is Unavailable" error

Posted on by Microsoft Employee

Hi 

I am using Xrm.Utility.openEntityForm to open a record form, which gives me error. But I can access it manually in its view grid without error.

Here  is how I use the code : 

Xrm.Utility.openEntityForm("karasyst_document",id);


And here is the error I get :

crm_2D00_error_2D00_openform.PNG

*This post is locked for comments

  • ansrikanth Profile Picture
    ansrikanth 3,115 on at
    RE: Calling Xrm.Utility.openEntityForm throws "Record Is Unavailable" error

    Bingoo !!! Would you mind If I ask you mark the solution and close the thread ?

    Thanks in advance, Srikanth

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calling Xrm.Utility.openEntityForm throws "Record Is Unavailable" error

    Yes you are right. My Bad, actually I was passing its child entity id instead of parent and now it is working.

  • Verified answer
    ansrikanth Profile Picture
    ansrikanth 3,115 on at
    RE: Calling Xrm.Utility.openEntityForm throws "Record Is Unavailable" error

    I don't see any chance of it being failed. The only reasons for this error can be (as mentioned in the message it self) a) the record is not there b) you don't have sufficient privileges to see the record.

    7875.Capture.PNG

    I just did a quick test using my console and found it is working fine. Can you please paste a screenshot of the record guid in CRM to validate this ? Also, how did you get this id ? it looks like there is "some" code which is returning the ID. Are you sure that it is returning correct id ?

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Calling Xrm.Utility.openEntityForm throws "Record Is Unavailable" error

    First, try this       Xrm.Utility.openEntityForm("karasyst_document",webResourceData);

    if failed , try this Xrm.Utility.openEntityForm("karasyst_document","5982d436-dfa4-e611-80e8-005056840629");

    if failed again, i suspect you get a wrong id.

    
                          
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calling Xrm.Utility.openEntityForm throws "Record Is Unavailable" error

    Hi 

    Here is my js code: 

    $("#div").on( "click", "a",function() {
    
    
    webResourceData=$(this).attr('id');
    
    Xrm.Utility.openEntityForm("karasyst_document"); // it opens the form correctly in new mode 
    
    console.log('"'+webResourceData+'"'); // output this >> "5982d436-dfa4-e611-80e8-005056840629"
    
    Xrm.Utility.openEntityForm("karasyst_document",'"'+webResourceData+'"'); 
    
    });

    Also this time when I put the id between double quotes, I get the following error : 

    crm_2D00_err_2D00_openform.PNG

  • Aileen Gusni Profile Picture
    Aileen Gusni 44,522 on at
    RE: Calling Xrm.Utility.openEntityForm throws "Record Is Unavailable" error

    Hi Babak,

    You try to copy paste the URL and then try to open it...

    Then you make sure that the ID is really correct, the record is not yet deleted and the entitytypecode there is 10015, which if it is incorrect then you should change your entity schema name in the bracket.

    Hope this helps.

    Thanks

  • Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Calling Xrm.Utility.openEntityForm throws "Record Is Unavailable" error

    Would you mind to share your JavaScript code here?

  • Suggested answer
    pavanmanideep Profile Picture
    pavanmanideep 1,329 on at
    RE: Calling Xrm.Utility.openEntityForm throws "Record Is Unavailable" error

    Hi Babak,

    You could just include double quotations to make this work, "GUID"  as per syntax

    Use

    Xrm.Utility.openEntityForm("karasyst_document", "GUID of the record");

    Instead of

    Xrm.Utility.openEntityForm("karasyst_document, GUID of the record);

    Thanks

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calling Xrm.Utility.openEntityForm throws "Record Is Unavailable" error

    When I use it with Xrm.Utility.openEntityForm("karasyst_document") it opens a create mode of form of that entity. I also checked the Id and the one I set using js is same as what I get from opening the from using grid.

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Calling Xrm.Utility.openEntityForm throws "Record Is Unavailable" error

    first,double check your Entity Logical Name, does it really named "karasyst_document".

    second, double check the id by accessing it through grid ( right click copy-link and look for the id ) and the id you get from JavaScript.

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