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)

Workflow - executing a child workflow -- not listed in related entity

(0) ShareShare
ReportReport
Posted on by

I'm fairly new to CRM.  I have a need to create a workflow where it checks an onchange of a couple of fields on the Contact entity.  I would like to execute a child workflow that updates something on the Lead entity.  I don't see "Lead" in the "Related Entities" list under the "start child workflow".  The only thing I see is "Originating Lead".  I tried using that but it errors out saying "A record required by this process could not be found".  I looked in the database record and noticed that there is an OriginatingleadID field, which I don't believe we are using that field at all.  Our contractor, who is not around anymore, created a custom field xxx_LeadID, which points to the lead record I'm am trying to update.  There is a 1:N relationship (contact : lead) on that field.  How do I go about making this workflow to fun successfully and find the proper lead record? 

Another question: 

Can we add to the "related entities" list?  How can I do that?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Deeps Profile Picture
    1,875 on at

    You are getting this error "A record required by this process could not be found" because the contact record does not have Originating Lead lookup populated. If contact record has that field populated then workflow will work fine.

    You cannot run a child workflow on 1:N records using OOB workflow designer.

    Related Entities List will always have all entity records that have lookup fields for that entity.

  • Suggested answer
    Sean Michel Profile Picture
    340 on at

    Hi LTr,

    If I'm understanding you correctly, you want to take action on the Lead from which the Contact was born? You won't need a child workflow to do this, and can execute it from Contact entity.

    In the workflow designer, as thecrm guy pointed out, you'll need to perform a null check for the OriginatingLead (or the xxx_LeadId field, whichever is being populated in your system - and it sounds like it may be the xxx_LeadId field) by using a Check Condition to verify that data is present in the field.

    Then, once you've verified the parent Lead is present, you can choose to include an "Update" step and choose to update the related Lead record.

  • Community Member Profile Picture
    on at

    I'm sorry I meant, the custom field xxx_LeadID(named Lead Contact) is on the Lead entity, it is a lookup to the Contact record which will have the Guid of the Contact person in the DB.  The OriginatingLeadID is not being used.  The xxx_LeadID field has a referential relationship defined as Contact=primary entity, Lead=related entity.  One contact can have many leads.

    If the originatingLeadID is empty, how do I do a check on it?   I can't just do a straight update from the parent workflow (Contact entity).  I needed to run a child workflow( Lead entity) because there are some checks that I need to do before doing the update. 

    BTW, I tried what Sean Michael said to do a check.  I did:

    If Originating Lead(Lead):Lead Contact contains data, then start child workflow

    It seems it didn't contain data so, it skipped it, ending the job as a success.  But, I need it to find my record and execute the child workflow.  So I don't think my IF statement is correct, or it could be, but still it isn't working the way I'd like it to.

    Anymore advice is appreciated!  Thanks!

  • Verified answer
    Community Member Profile Picture
    on at

    Your Lead is the "child" to the "parent" Contact. The lookup field is on the child record ( a child looks up to their parents, right?). It seems like it was named badly, since it is really a ContactID field. Never mind, I've seen that a hundred times.

    So, you can't run a Workflow on all child records when something happens to the parent record. Or at least, not "out of the box". And how will it know which Lead to update? Or should it iterate through all of them, in which case, have a look at the free Distribute Workflow 2011-2015 tool on Codeplex:

    https://crm2011distributewf.codeplex.com/

    A "child" workflow is simply one that is called by another. Often used for doing the same steps from different starting points. Have a read of this for background understanding, even though it is not what you need to fix your requirement:

    When and How to use Child Workflows in Dynamics CRM

  • Community Member Profile Picture
    on at

    I was able to use the distribute workflow tool.   I'm not sure if this is normal and okay.  But with what I did below, it will execute for all leads related to the contact. (If one contact has 5 leads, the workflow will execute 5 times.) It seems to work though.

    So this is what I did:

    On change of fields on my parent workflow (contact entity) will use the "distribute one-to-many" option from the tool to execute my child workflow that will do some checks before making an update to the Lead entity.  

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