Creating connections between entities in Microsoft Dynamics CRM can hardly be described as intuitive. However, there is a simple way to connect entities: Dialogs.
In this blog post, I will guide you through connecting the interests of a contact to said contact step-by-step.
- First, create a process „Contact – Connections: Interests“ for the entity Contact in the category dialog field. This dialog should be an on-demand and child process.
- Add a variable „_mandatoryfield“. Set the data type to Integer and the default value to 0.Thus, a user will always have to assign a value (see step 4) to the interest.
- Now, add a step Query CRM Data „Query interests“. In this example, Interest is a custom entity.
- Add a page „Select interest“ and fill in the prompt text „Which interest should be added to the contact?”. Set the response type to Option Set (radio buttons), which uses the query variable Check interest of step #3.
- Now, add a step „Assign value“. There, set the variable _mandatoryfield to 0. This way, the dialog can later be traversed recursively.
- Add a check condition which will check whether the user assigned a value on the dialog page Select interest (see step #4). If no value was assigned, the variable _mandatoryfield will be set to 1.
- If the variable _mandatoryfield equals 1, an additional check condition will ask the user to go one step back and to select an interest, or to stop the dialog.
- A default action sets the variable _mandatoryfield back to 0 and the important step Create Record to create a connection is taken. Note: Interest and Interested party are custom connection roles.
- Recursion: Add a page „Connection successfully created!“ on which the user is asked whether he wants to add another connection. Use the response type Option Set (radio buttons) and defined values Yes and No.
- Finally, add another Check Condition which evaluates the reaction value selected in the previous step (Page Connection successfully created!). Yes re-starts the dialog to create another connection, No closes the dialog.
That’s it! In just ten steps you can thus create the desired connection. Repeat this process to create connections between any entities.
Here’s one more tipp: Use a „main dialog“ which starts all other dialogs to create connections. This main dialog has to feature a selection of sub-dialogs. If you customize the sub-dialogs, you may reuse the recursion.
Have fun customizing!