Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

getEntityTypes() function does not exist

(0) ShareShare
ReportReport
Posted on by 40

Hi, I followed the same instruction found on this link:

https://community.dynamics.com/365/b/dynamics365enterprisecloudfronts/posts/filter-customer-type-field-to-display-only-accounts-in-d365-v9-0-using-javascript

Im using field named "customerid" instead. However, when accessing getEntityTypes(), it gives me an error. 

The only available functions are below:

pastedimage1610706131665v1.png

Is there any wrong on how I write the code or maybe due to version of the CRM?

Thank you in advance

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: getEntityTypes() function does not exist

    Jerome,

    If getEntityTypes is not there - you can't make it appear, unfortunately.

    If my reply (or replies) answers your question take a minute and verify the answer. You can do it by clicking "Yes" at the top of the reply (or replies) under the label "Does this answer your question?"

  • Suggested answer
    Jerome Vicente Profile Picture
    40 on at
    RE: getEntityTypes() function does not exist

    Hi Andrew,

    The solution you provided seems good since it could not display Contact records. I came up with the solution with some modifications:

    function defaultcustomer(){

              Xrm.Page.getControl("customerid").addPreSearch(addFilter);

    }

     

    function addFilter()

    {

             var customerAccountFilter = "<filter type='and'><condition attribute='contactid' operator='null' /></filter>";

             Xrm.Page.getControl("customerid").addCustomFilter(customerAccountFilter, "contact");

    }

    If there is a way that it can hide the Contact from the dropdown list, it would be much better.

    Thanks,

    Jerome 

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: getEntityTypes() function does not exist

    Hello Jerome,

    That's weird because it seems this function was added in 8.1 version - dreamingincrm.com/.../

    If it's not available I would recommend to take a look on the alternative way to restrict the values available to a lookup control - powerobjects.com/.../

  • Jerome Vicente Profile Picture
    40 on at
    RE: getEntityTypes() function does not exist

    Hi Andrew,

    This is what is indicated on the CRM:

    Microsoft Dynamics 365

    Versione 1612 (8.2.4.6) (database 8.2.4.6) locale

    Thanks,

    Jerome

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: getEntityTypes() function does not exist

    Hello,

    What version are you on?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,206 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,968 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans