Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Auto populate the lookup field

(0) ShareShare
ReportReport
Posted on by

Hi,

I am new to CRM . I created a two entities called (new_university) and (new_student),

In  new_student  entity i have a fields called University ID which is plain text filed and University code Which is a lookup field and in new_university  entity created a field called University ID (plain text).Now the problem is when i enter the student_university ID(plain text) in new_student entity it  should compare with University_University ID (plain text) .if it equals, the value should be set to the lookup field in student entity(University code). i tried to do with workflow but it is not working

My workflow conditions:

If student_university ID equals to university_university ID ,then

Update student_university code 

so, I am trying to do with Java Script ,but i am new to java script 

Can anyone help me to achieve this 

Thanks in Advance 

John Adrew

CRM Developer 

 

*This post is locked for comments

  • Suggested answer
    Abdul Wahab Profile Picture
    12,085 Moderator on at
    RE: Auto populate the lookup field

    Hi John,

    You can able to do it through custom workflow, plugin and JS. Kindly follow below steps to do it in any way:

    1. Retrieve student entity and filter it through university Id.

    2. If you have record count is equals to one.

    3. Fill out your desire lookup field.  

    If you have any query do let me know.

    Thanks

    Regards,

    AW

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,188 Moderator on at
    RE: Auto populate the lookup field

    Take a look at the following.

    It contains the steps, sample code and a sample solution you can download.

    I saw multiple requests for the same this week, so decided to write something up...

    community.dynamics.com/.../populate-lookup-field-based-on-related-entity-value

    Hope this helps.

  • Community Member Profile Picture
    on at
    RE: Auto populate the lookup field

    Hi Aric ,

    Thanks for reply,

    I tried using  REST Builder . but the thing i am not able to compare the values from 2 different fields and i am very new to java script . i am not able to retrieve the value from university Entity  with out any entity reference ,

    Thanks

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,188 Moderator on at
    RE: Auto populate the lookup field

    Take a look at the following:

    community.dynamics.com/.../263071

    I think this is a very similar question which might provide you an answer for what you are looking for. At this point it is not yet verified, but I think the answers you see there should give you the right approach on how to implement this.

    Basically you need to use SDK.REST to retrieve the data from the related entity, and get the Guid of the entity you are looking for, and then populate the lookup field from the value you retrieved from the REST call.

    Hope this helps.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans