Monday, February 28, 2011

MSCRM: Creating a Personal View

The Advanced Find feature in Microsoft Dynamics CRM is very powerful. You can search on almost any field in any entity to get information that you might need. In the following example we will return all of the contacts that have had an Account created in the last 10 days so that a welcome mail can be sent.

1. Open Advanced Find.
2. By default, Advanced Find automatically selects the Entity that you are working with as its default Look for. If you were working with Contacts when you started the Advanced Find, change the look for to Contacts.
3. Because you are going to be sending a piece of mail, you want to ensure that the columns you need to do this are displayed on your newly created view. Choose edit columns from the top toolbar and the Edit Columns dialog box is displayed.
4. Select Add Columns located on the right navigation pane of the dialog box. Add all of the columns that you would like to display in the view and click OK to continue.
5. Configure the sort order that you’d like to have by selecting Configure Sorting. Click OK twice to continue.
6. You need to add the criteria now to your Find because you have selected only the Contacts and the fields you want returned. If you were to run the Query now, you would return every Contact and not just those that are associated with an Account created in the last 10 days. To add this logic, mouse over the Select option, it changes to a drop-down. Scrolling down the drop-down, you will notice that the available fields to apply a filter to are broken down into two sections:
a. Fields
b. Related

Fields are the base fields for the entity you are working with – in this case, the fields for the Contact entity. Notice that every field applicable to the Contact entity is listed there, along with any custom fields you might have added.

Related enables you to select related entities to the primary entity you are working with – in this case, the entities related to the Contact entity. Every relationship to the Contact Entity should be listed there along with any custom ones added.

Select the Parent Customer (Account) from the Related section.

7. Now that you have the relation established, you need to add the last bit of logic, accounts added within the last 10 days. Mouse over the Select under Parent Customer (Account) and select Created On. Notice that the fields displayed are of the base entity Account – this is because you are now working and able to query on the fields for the related entity. Change the option to last x days and enter 10 as the value.
8. Selecting Find returns all Contacts related to Accounts added within the last 10 days. With the results, you can now perform a mail merge, export them or even create a quick campaign.
9. To save this view that you just created, go back to the Advanced Find screen and Choose Save As and give the view a relevant name. This view will now show up in the drop-down of views in the Contacts screen under My views.

No comments: