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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Check Associated Record Value Javascript

(0) ShareShare
ReportReport
Posted on by 15

Hi

Hope somebody can help. I'm trying to create some code that checks an associated (let's call it 'Preference) record's value when selecting the same value from a new ('Preference') record for a contact. It should then display an error message if that value within an existing ("Preference') record exists. Sorry if that's a bit vague. New to this.

Any help would be super appreciated!

I have the same question (0)
  • Suggested answer
    Marco.P Profile Picture
    2,405 on at

    Hi,

    may I ask, why don't you use a duplicate detection rule?

    https://rocketcrm.co.uk/dynamics-365-duplicate-detection-rules/

    It seems to me like the perfect choice to fulfill your requirement!

    If you wanna do it using ha, then write down a function that retrieve the preference record and add a validation function like this:

    hihaj.com/howto-client-side-validation-of-dynamics-crm-forms-1c84cd02c15a

    Hope it helps!


    If you found the answer helpful for you or other readers, please mark as Verified.

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    If you want to check/retrieve value from other record in JavaScript, you will have to use WebAPI to query that record. Take a look at the below article-

    community.dynamics.com/.../get-lookup-value-from-other-entity-and-set-it-on-the-form-using-web-api-in-microsoft-dynamics-crm

    Hope this helps.

  • M4ttg1lbert Profile Picture
    15 on at

    The latter is probably favourable. Will give it a go when I get a chance.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans