web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    What version are you on?

  • Jerome Vicente Profile Picture
    40 on at

    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

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    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/.../

  • Suggested answer
    Jerome Vicente Profile Picture
    40 on at

    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 

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    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?"

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 45 Most Valuable Professional

#2
iampranjal Profile Picture

iampranjal 36

#3
Satyam Prakash Profile Picture

Satyam Prakash 31

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans