If you have a requirement to limit the number of child records possible in a 1:N relationship, the Dynamics Rollup field is a handy way to achieve the restriction.
This solution has three parts:
Two entities with 1:N relationship to each other.
Rollup whole number field on parent entity configured to use the COUNT function which counts the child records.
On create workflow on child entity with a condition to evaluate the value of the rollup field and stop record creation if it exceeds the allowed record count.
(1) Create the rollup field on the parent entity.
Data Type = whole number
Field Type = rollup
Click the Edit button to configure the rollup.
You can also add a filter to limit the function to only count child records which meet a specific criteria; like, have a certain eye color.
(2) Create a workflow on the child entity. Configure it to run “on create” and as the very first step evaluate the value of the rollup field. If it exceeds the number of records allowed, “Stop” the workflow as CANCELLED and configure an error message to display to the user.
TIP: Add a step to call a forced calculation of the rollup at the end of the workflow. This ensures it has the correct value at all times. A plug-in to force a calculation can be found in Dynamics 365 Workflow Tools.
This post is about technology related to Microsoft Dynamics CRM and contains facts as they relate to the 2016 Online version, but may also apply to earlier versions. In the previous post on this topic, Dynamics CRM Activities, Activities were introduced. In this post, we review the implications of making an entity an Activity.
My first foray into Dynamics began last October with 90% custom entities. I was a babe in the woods with no Dynamics experience or training. I figured things out as I went along. All the while I had this nagging concern that I would make a decision that would have downstream implications. So far, there have been a few gotchas, and the most recent one relates to Activities. This type of contextual information is where the Microsoft help is so wholly deficient.
A entity can be a type of Activity. This causes the entity to be created with some default functionality related to activities; like start time, stop time, duration, resources involved, etc. as outlined in Dynamics CRM Activities. See 1 in the screenshot below.
An entity can have related Activities. See 3 in the screenshot below.
Both of these configuration choices are made during Entity Definition and are permanent. Once you save the entity you cannot change this configuration option.
What does this mean? Here’s what I’ve discovered:
An entity can be an Activity
When creating an entity, you have a choice to make it an Activity type by checking the Define as an activity entity checkbox. Checking that box is final. It cannot be changed, which means more than I realized at first.
First: The entity is created with a handful of default attributes with special powers. One of them is a Regarding lookupattribute. This lookup is populated with all records from all entities which can have related Activities. Out of the box, that’s Account, Cases, Contacts, and others.
If you create a record for this entity from a parent, like a Case, the Regarding attribute is automatically populated with the primary key from the Case record. If, however, you create the entity outside of a parent, the Regarding attribute is not pre-populated.
Like mentioned in the previous paragraph, the Regarding lookup is populated with all records from all entities which can have related Activities. This is problematic if you intended for the Regarding to always be one record type.
For example, I created a File Room Request entity that should only be related to Cases. When a user is creating a File Room record from a Case, Regarding is pre-populated with the Case’s primary key. However, if the user creates it from a View or a Dashboard, the Regarding is not pre-populated and the user can select anything. They could make the mistake of associating it with a contact.
Second: As an Activity entity, the View ribbon displays a button for each entity defined as an Activity. In this screenshot you can see Task, Email, Phone Call, Fax, Campaign Response, and under Other Activities are the custom entities you’ve created as Activity types.
Third: Where Activities appear in the user experience is different and you must consider this as it relates to the overall user experience. Because I checked the Define as an activity entity checkbox when creating the File Room Request entity, I now have File Room Requests launched from the Activities ellipsis on the Case form; whereas, I have other case-related related entities launched from sub-grids. I could add File Room Request to the a sub-grid as well, but can’t remove it from Activities. Too many ways for a user to skin the cat creates confusion.
Note: You can prevent the entity from appearing in the Activities menu shown in the screenshot above by unchecking the Display in Activity Menus checkbox during Entity Definition as shown in the first screenshot.
Fourth: The icon you select for the 32×32 dimension (you can specify a 16×16 and 32×32 icon for a custom entity) must be designed to appear on a white background; otherwise, it will blend into the background on the form it’s on. You can see it working correctly in the screenshow above.
This is the same 32×32 image used on the Site Map as the sub-area icon; so consider its design carefully. Related Site: www.flaticon.com. Free simple icons that can be downloaded in pre-specified sizes and colors.
I now wish I could figure out how to change all the OOTB icons because I like my white background better. 😉
Fifth: If an entity is defined as an Activity, it appears in the Activities View which is filtered on entity type. Not such a big deal; but consider the user experience and what appears there vs. doesn’t appear there in the context of all of your solution’s functionality. If they see Tasks, Phone Calls, Appointments, and records from any other activity defined as an Activity type, they may have stop and think why something doesn’t appear that that “feels” like an activity. If your user has to stop and think, you’ve failed in your UI design.
An entity can have related Activities
During Entity Definition you can also specify whether the entity you’re creating can have related Activities. You choose this option by checking the Activities checkbox in the Communication & Collaboration section of the Entity Definition dialog as shown in the first screenshot of this post.
The downstream impact is as follows:
First: The ACTIVITIES section is available for displaying on the entity’s forms. Each item with a red dot is an example of an entity configured as an Activity type described in the first section.
Second: The Activities icon appears in the related navigation section when clicking the down arrow to the right of the record’s name.
In the second installment I’ll explain all of the unique attributes of an Activity entity.
Below you learn how to create a custom logo for your Dynamics CRM instance using a layered Photoshop file. I have provided the DynamicsLogo.psd below in order to make quick work of it so you can get back to the fun of customization.
I use the word instance with great intention as opposed to Solution. The reason is that the Theme applies to the entire instance, not just one Solution within the instance
Modify Text in Photoshop
1. Open the DynamicsLogo.psd file provided below.
2. Click the eye icon on the left side of Layer 1. The layer’s black background is now displayed so you can see the white text you’re creating. We’ll turn it off before saving so the image can be displayed on any dark background.
3. Click in the middle of the text you want to change. You must click within the text; otherwise, you will create an additional text box, which is not what you want.
4. Change the text to display what you want to show in the logo.
5. When done making the change, click the checkmark from the button bar.
6. Repeat steps 3 thru 5 for the Line 2 text.
7. When done making your changes, Save As a PNG file.
Upload to Dynamics
1. Click Settings > Customization > Themes.
2. Select the theme you want to change.
3. Click the search icon in Logo field.
One Line? If you don’t want two lines, drag the Text 2 layer to the trash can shown at the bottom of the Layers panel, then center the Text 1 layer so it fills the space you desire.
Image with or without text? To insert an image, simply place it and size it within the size of the image.
If you need help modifying this file, consider hiring my son who has an undergraduate degree from one of the top art schools in the country and isn’t earning a living wage. He’ll do a quick tweak with the font of your choice for $25 USD. Send me an email if this is your desire.
~ managing a Microsoft Dynamics project using Agile and OneNote to capture and bring order to your brilliance ~
Microsoft’s OneNote has saved me from myself. I am slightly ADD and have brilliant moments at inopportune times. I manage my self-induced stress with order and structure, and this blog series will detail how I’ve done it using OneNote on my laptop.
Here’s a quick overview of the process; details to come later:
During requirements gathering …
customer input explodes into a fireworks burst of more questions, ideas, and things I need to remember to do. Dear G_d, the chaos and the sleep loss.
After requirements gathering …
the chaos (er — details) are brought to order into a product backlog of stories and tasks I need to accomplish. The priority of the items are managed on a regular basis both with and without my customer by simply dragging and dropping to re-order.
Along the way, if order can’t quite be achieved, items (stories, tasks, random notes in no particular place) are tagged for follow up with other resources, as needed. When a resource is in front of me — either by invitation or accident — I quickly locate all tagged items needing their input. How sweet it is.
When a story is Done …
it’s status is changed and it’s moved to the Demo area. As Demo Day approaches, the stories in the Demo area are combined into a cohesive set of business scenarios grouped by User Role. Momentum rules. Distractions distract.
During the Demo …
another round of chaos begins (er — feedback) and everything is documented in a “scratchpad” area. Once the Demo is done, each story’s status is changed to Done and it’s moved to the Done area.
After the Demo …
the recent round of chaos is processed back into order by transferring from the scratchpad area to the backlog and reordering priorities accordingly. Pick up next on the list and keep moving forward. The cycle continues and sleep prevails!
Ah, the beauty of order and structurebrought about by OneNote.
The back story:
This series is focused on how I use OneNote to bring order to a ridiculous yet exhilarating Microsoft Dynamics project managed using pieces of the Agile methodology. I perform in the roles of business analyst, project manager, scrum master, and Dynamics configuration specialist (with no prior Dynamics knowledge or training). That’s the ridiculous part. The exhilarating part is seeing the final solution come to life and delight the customer.
Agile purists would argue this isn’t Agile done well; and it’s not. It fails on many of Agile’s principles, including establishing a sustainable pace. Not many could sustain the pace I’m working at for any length of time, but I have tons of flexibility with when I can work both from my personal and work life perspectives.
It is what’s working for now to get feedback early and often given my unique circumstances; my time with the customer is limited; funding is limited; tolerance for change is limited; and technical understanding by the customer is limited. My customer (and employer) is a US governmental agency, so I either I jumped in and took it on or it wasn’t going to get done — for a very long time.
Given these circumstances, one either figures out a way or comes to their senses and bails out when presented with such a challenge. I chose the former, and am blessed to be supported by an incredibly awesome manager who stands back and steps in, as necessary. As well as a husband who gets it when I’m in the zone and has become quite the “Call of Duty” warrior as a result.
Oh, and the Microsoft Dynamics Community. Go there — early and often as they say in testing circles. The resources are gracious with their time and swift in their responses.