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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

String text field can lookup entity list in dynamics CRM

(0) ShareShare
ReportReport
Posted on by

Hello all,

I create new function to setup number sequence for entity in CRM System, I create new attribute is called Entity Name (string data type, mean which entity you want to generate number), and other attribute is called Entity Attribute (string data type, mean which attribute you want to assign number automatically) 

5282.1.png

My question: I don't know how to create lookup to list all entity name and entity attribute of entered entity name.

I do research and found some ways but I still can not do and get some problem:

1. Can add javascript at onload event in form. Javascript will get Entity name via plugin as ODATA, and build array var[], then set arrary to control.

=> Question:

- For array, as I research must have 3 information: id, name, entityType, but for this scenario, we don't lookup to specific entity like lead, contract, contact, so how to fillin this value ?

- When I setValue array to control, it throw error invalidType ?

function LoadEntityList() 
{ 
     var EntityLookup = new Array(); 
     EntityLookup[0] = new Object(); 
     EntityLookup[0].id = ?? ; //If I build lookup to specific data like Lead, Contact, I will have entity Id, but now we get Entity name so what value id here ?
     EntityLookup[0].name = "lead"; //May be name of entity 
     EntityLookup[0].entityType = "lead"; //May be name of entity      
     Xrm.Page.getAttribute("entityname").setValue(EntityLookup); 
}

2. Base on form Duplicate rule setup, I use F12 Tool how to bind entity name as list at attribute Base record type
7357.a.png

First thing: Base record type is single line or text (it is not a lookup)

Second thing: use F12, I can set list of option as select

5710.b.png

Third thing: check javascript in form, and don't see any javascript and onload event method in this form

8424.c.png

=> Question:

- How can Duplicate Rule form load entity name as list at Base record type ?

Thanks you so much for any comment and guide for me.

*This post is locked for comments

I have the same question (0)
  • Moshe Hayun Profile Picture
    365 on at
    RE: String text field can lookup entity list in dynamics CRM

    Hi,

    I wrote some code for a mechanism like this few years ago. Why do yu want EntityName field as a Lookup / Picklist? For me, it was a simple string field, and then, in plugin, I looked for a AutoNumber record that contains plugin's triggered entity as EntityName.

    Anyway, there are many tools on internet to achieve this now. Have a look at this: crm2015autonumber.codeplex.com

  • Community Member Profile Picture
    on at
    RE: String text field can lookup entity list in dynamics CRM

    Hello,

    At the current development status, I ask End Users to input manually Entity Name and Entity Attribute by take a look into solution and find Entity then find Name and Attribute Name, but they search and watch some Number Sequence Customization Demo are shared in YouTube, so they request me need to put lookup in Entity Name and Entity  Attribute.

    I will review your reference, and give feedback. 

    Thanks you so much.

  • Community Member Profile Picture
    on at
    RE: String text field can lookup entity list in dynamics CRM

    @Moshe Hayun:

    I have seen usefull class in your refer link: RetrieveAllEntitiesRequest, RetrieveEntityRequest. I will check and feedback later.

  • Moshe Hayun Profile Picture
    365 on at
    RE: String text field can lookup entity list in dynamics CRM

    OK, they're SDK classes.

    But, correct me if I'm wrong, how many records of Entity Number Sequence will you have? One per entity, right? With the name of the attributes that will contains the number. Am I right?

  • Community Member Profile Picture
    on at
    RE: String text field can lookup entity list in dynamics CRM

    Hello,

    May be 20 records of Entity Number Sequence.

    You are right, but with my case is more complex:

    => One per CRM Entity will has 1 - N record in Entity Number Sequence, because one Entity may have many fields need to generate number automatically, each Entity name and Field name (Attribute name) will be one record in Entity Number Sequence. Beside that, formular in Entity Number Sequence is complex, include period, constant, prefix, suffix, attribute value with formatted (example: currency code has value Dollar, but when combine into number sequence, it will be USD).

    Thanks.

  • Moshe Hayun Profile Picture
    365 on at
    RE: String text field can lookup entity list in dynamics CRM

    Hello,

    It's more complex, it's true.

    But, in your place, I will keep these attributes in type string.

    These are not things that end users will often change. And the ideal, it would be that the only the sys. administrator (or customizer)have the privilege to modify these records.

    And then, to what type do you want to modify these fields?

    Lookup? This is not possible, a lookup field must point to a certain type of records. "Entity" is not a record type.

    Picklist? This will be a picklist that will be loaded dynamically during the OnLoad of the form. And since it is loaded dynamically, it will never contain any value in the database. You will need another text field in which you will copy the selected libel in the picklist.

    Is it worth it for something you will not use on a daily basis ?? Up to you to decide... :)

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans