Announcements
No record found.
Hi All
In the Opportunity form I want to auto populate account field when user select a contact. I have tried with JavaScript approach with below steps.
01.Get contact ID
02.Get AccountID for Contact ID
03.Get Account name
I feel there should be an easy way do this. Could you please help me?
Hello,
The general logic for the script is following:
1. Get the contact id from the form.
2. Use Xrm.WebApi to get the information from the "contact" record.
3. Populate the "company" lookup based on the data from the previous step.
The most challenging part is step 2 and the following post gives you almost the fully functional script for that - www.inogic.com/.../
Hi Saman,
you can create a workflow to achieve it, which is a no code way and easier than js.
You can refer following steps.
1.Go Settings > Process to create a Real Time workflow on opportunity entity
2.Trigger it on Create and contact field change.
If you want to fill account from contact automatically for existing opportunities, you can check 'As an on-demand process'
3.Update the value of account from contact.
4.Save and Active it.
5.Test.
Fill contact field and save it, the account field will be filled automatically.
Regards,
Leah Ju
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.
Thanks Leah
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Travis South 54
11manish 33 Super User 2026 Season 2
Syed Aqib Raza 31