Skip to main content

Notifications

Microsoft Dynamics CRM forum
Suggested answer

How to update lookup field from one entity to another entity

Posted on by 45

In Opportunity i have 2 lookup fields called Opportunity category & Primary solution division.Now in quote product(entity) I have 2 lookup fields called Product division & Product category.I just want to update values into these two lookup fields from the Opportunity lookup fields whenver we create a quote product for the same opportunity.See my below screenshots.Both are different Entities & its not possible with workflow and business rule & field mapping.So Pls help me on this.

4380.PNGQuote Product fields

  • mehdi.sadeghi Profile Picture
    mehdi.sadeghi 60 on at
    RE: How to update lookup field from one entity to another entity

    hi you can solve this problem by two way:

    1- in sql server you must create a daily sql job that daily update this lookup field from source (asynchronous)

    2- create a step workflow (by visual studio) on Quote Product then call this step by real time workflow for update your fields (synchronous)

  • irfanshaikh786 Profile Picture
    irfanshaikh786 45 on at
    RE: How to update lookup field from one entity to another entity

    Thank you charan & Jupitar for replaying on my post.

    I have check with script & plugin but its not working can u plz share the script code.Also if needed i will share the fields name & logical names.This will be helpful for me

  • Suggested answer
    Jupiter Alappat Profile Picture
    Jupiter Alappat 235 on at
    RE: How to update lookup field from one entity to another entity

    Hi Irfan,

    Please check the comment by Charan and hope it helps you to move forward.

    If you still have any questions please do let us know. Glad to help.

  • Charan Raju C R Profile Picture
    Charan Raju C R 3,155 Moderator on at
    RE: How to update lookup field from one entity to another entity

    Hi Irfan,

    I assume the relationship between Opportunity and Quote Product is as below. Please correct if my assumption is wrong.

    Opportunity --(1:N)--> Quote --(1:N)--> Quote Product

    Your requirement is to map Primary Solution Division and Opportunity Category from Opportunity to Product Division and Product - Category in Quote Product respectively.

    To achieve this, you can use both option 1) & 2) or only option 2) below.

    1) Client side, you need to create a javascript function onload of Quote Product form to fetch and update these two lookup fields from Opportunity via Quote.

    2) Server side, you can create a plug-in on pre-create (preferred) of Quote Product to fetch and update the lookup fields from Opportunity via Quote.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,524 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,469 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans