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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

set a lookup field value

(0) ShareShare
ReportReport
Posted on by 790

dear all

i do have a workflow that creates two different entity records (RecA / RecB), and i want to set a lookup field value on RecA to contain the value of RecB.

please help.

thanks,

*This post is locked for comments

I have the same question (0)
  • David Jennaway Profile Picture
    14,065 on at

    This should be straightforward. If you create RecB before RecA, then in the 'Look for' drop-down list of entities on the RecA form, you should see an entry for RecB at the bottom of the list, under 'Local Values'

  • gdas Profile Picture
    50,091 Moderator on at

    Hi Ahmad ,

    You can also do using field mapping -

    itsolutions.bdo.ca/.../using-field-mapping-in-microsoft-dynamics-crm-to-copy-data-between-associated-records

  • Ahmad Saud Profile Picture
    790 on at

    Let me clarify more, when lead qualifies, it creates opportunity(RecA),and i have a workflow that creates RecB(custom entity) on creation of opportunity, now i need the lookup value of RecB to be placed on opportunity (RecA).

    sorry for not elaborating enough right from the beginning.

    thanks,

  • Ahmad Saud Profile Picture
    790 on at

    thanks, Let me clarify more, when lead qualifies, it creates opportunity(RecA),and i have a workflow that creates RecB(custom entity) on creation of opportunity, now i need the lookup value of RecB to be placed on opportunity (RecA).

    sorry for not elaborating enough right from the beginning.

    thanks,

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Ahmad ,

    Please refer below article -

    www.itaintboring.com/.../dynamics-crm-use-a-workflow-to-set-a-lookup

  • Verified answer
    Community Member Profile Picture
    on at

    Hi Ahmad,

    You cannot do this using oob workflow designer as there is no provision for updating 1:N entity records. Only N:1 can be updated. In the example you mentioned RecB is a lookup on Rec A which makes it 1:N from BtoA. You should leverage a custom way to do this.

  • Saddamk206 Profile Picture
    777 on at

    Hi Ahmad

    As i understand you need to create a custom workflow activity. And you can achieve this scenario like Guid RecAguid=service.create(RecA);

    Then assign RecAguid in lookup of RecB.

  • Ahmad Saud Profile Picture
    790 on at

    Ho Goutam

    field mapping did not work in my case.

    one thing can be the reason behind this issue, is it possible to make one record a child for two parent records?

    thanks,

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

    Hi Ahmad,

    Are you creating both the record at once from a workflow, if yes then you can achieve this without custom code. You need to create RecB first and then while creating RecA, set RecB from the dynamics values under local values (This would appear with teh name of step).

    Even if you have are creating records separately, you could still update child records by using the Dyanamics 365 Workflow Tools -

    github.com/.../Update%20Child%20Records.md

    Hope this helps.

  • Ahmad Saud Profile Picture
    790 on at

    dear Goutam

    please email me privately on ahmadfl2000@hotmail.com , i have some business with you.

    thanks,

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans