1

I'm working on creating some custom workflows within Dynamics 2013 CRM. I thought I had the process all figured out, and created a workflow that when viewed seems to make logical sense. However, it does not produce the desired result.

Here's what I'm trying to do:

The Opportunity has a custom field that is "looking for" a specific model of item. That is a lookup field against a separate entity "Model". Then, in the products entities, I have a field called "model" that is a lookup against the same entity list (so the values should match). My workflow (which as this point can be run manually on each product in the system) is supposed to detect when there is a match between what any opportunity is "looking for" and the "model" of the product. If there is a match, it is supposed to create a new record "match" that will include several fields detailing both the product and the opportunity that created the match.

The workflow claims to run successfully, however no "match" record is ever created. I've simplified the workflow to simply create a "match" with the name "test", but I still have no success. I'm suspecting that I did not set up the relationship between these fields correctly, but I don't know how to troubleshoot that, nor how I should have set it up, and I cannot find any instructions to assist with this process. I'm hoping someone else has had more experience with this than I have and can point me in the right direction and help me get this workflow working.

Arun Vinoth - MVP
  • 314
  • 1
  • 3
  • 15
  • Okay, after browsing a while I've come up with a first troubleshooting step. I set a conditional case so when it does not match it creates a record named "failure". It creates that record every time it is run. I also tried to have it update a field in the Match record it creates with the value of the "looking for" field, but it doesn't produce a value - so I'm assuming when it tries to get the value of that field it gets null, and since null doesn't match the "make" of the product, it fails. I'm going to remake the relationship and try again. – Ajsherman22 Jul 27 '14 at 02:04
  • Okay, so looking further I had these relationships set up at 1:N relationships from the perspective of the opportunity. I felt like that was backwards, so I've deleted those and created a new 1:N relationship from the perspective of the product. However, those do not show up as a "related entity" option in the dynamics values space. I clearly used the first option because it allowed me to create the workflow I wanted... So that's odd. – Ajsherman22 Jul 27 '14 at 02:12
  • Okay, I've found a source that indicates you can only use N:1 mappings for workflow processes, and that includes check conditions. I must be setting something up incorrectly. Has anyone else done what I'm trying to do? – Ajsherman22 Jul 29 '14 at 23:50

1 Answers1

1

On the surface of it I'd say what you're trying to do is impossible without writing (Visual Studio and C#) a custom Workflow Action.

The reason for this is simple. OOTB Workflows can't query data, they can only retrieve single records. What this basically means is that a Workflow can run UP a relationship tree but not DOWN. It can go from child (N) to parent (1) but not the other way around.

What you are trying to achieve is exactly what an OOTB Workflow can't do. You are trying to retrieve a record's children. Your Products are children of the Model parent.

Basic simple rules for this terminology:

  • The entity with a lookup field is the child. Lookup value is the parent.
  • The entity with a Related View is the parent. All records listed in the view are its children.
Lior Abel
  • 61
  • 5