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

Announcements

News and Announcements icon
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

I have the same question (0)
  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    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.

  • Community Member Profile Picture
    on at

    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,190 Moderator on at

    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.

  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    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

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans