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 :
Microsoft Dynamics CRM (Archived)

CRM 2011 OOB workflow - Accessing child records from parent entity

(0) ShareShare
ReportReport
Posted on by

Hi,

I have created 1:N relation ship from Opportunity to a custom entity respectively.

I have created a workflow with send email step. In the email body, I am trying to read the child record attributes but the values are not getting displayed in the email.

I think the problem is - As there can be 'n' records  for a particular opportunity, the system is unable to recognize the fields, from which child it has to pick the values..

I want to access the recently created child data from the opportunity(parent) in the email body. How can I achieve this?

Thanks,

Raghu.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    jlattimer Profile Picture
    24,562 on at

    In most cases creating a custom workflow activity using .Net would be the preferred course of action as there isn't really any good to to pull in the N number of child records into a usable format. You certainly could create a field(s) on the parent and update it it with the child record information and use that field in a workflow but you won't have that much control over the formatting of the output in an email body.

  • Suggested answer
    Karth Profile Picture
    on at

    “Recently created child data” is the key here.

    The best way to achieve this is through custom development. But, there’s an alternative which may not be as good as doing it through custom development.

    Configure a workflow, which fires upon creation of the child record. This workflow picks up the necessary information on the child record and updates it on the parent opportunity record. You need to have appropriate fields configured on the opportunity form to capture this information. Now that all this information will be available on the Opportunity form, you will easily be able to access this information on your workflow to send email which runs on the Opportunity record.

    Note that every time a child record is created, the fields on the opportunity entity are overwritten.

    Do you want to evaluate this option?

  • Community Member Profile Picture
    on at

    Hi Karth,

    What you said about the key is correct.

    I thought of two approaches - One is custom development and another is a dirty method though.

    Custom Development - Written a plugin on parent record update which will copy the approval status field from parent record to recently created child record.

    and then designed a OOB workflow which will send the mail on update of its approval status.

    Dirty Method - Have all the child record attributes which are needed in the mail template and then set their values from JS.

    I have chosen the plugin option and proceeding with it.

    Please let me know if you can suggest any other optimized way.

    Thanks,

    Raghu.

  • Community Member Profile Picture
    on at

    One of the SMEs suggested me that this can be achieved using a mail merge template.

    Any idea on how to achieve it using mail merge template?

    Thanks,

    Raghu.

  • Suggested answer
    ScottDurow Profile Picture
    21 on at

    Hi,

    You can use a mail merge template under some circumstances (depending on what you need to do) in order to group your child records by opportunity so that each set of child records are grouped on a single page per opportunity. To do this you need to create an export of the child records but also include the parent opportunity fields you need on every row - then you can follow the instructions described at support.microsoft.com/.../294686

    Hope this helps,

    Scott

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans