A marketing list can be only one of three types, an Account, Contact, or Lead, so when marketing lists are created, you can specify the type of members that can be added to the list. For example, if you create a leads list, you can add new leads to the member list but you cannot add accounts or contacts.
It is likely that most new marketing lists your business creates will be one type, for example, leads. To prevent mistakes during the creation of new lists, the marketing manager can request the enablement of a default type-value to appear in the Member Type list box. By using the Customize Entities area in Microsoft Dynamics CRM Online, system administrators can set the default typecode for newly-created marketing lists per the marketing manager's request. The following steps walk you through customizing the Member Type typecode field using an OnLoad event.
Prerequisites
To make the changes suggested in this article, you must have the System Administrator or System Customizer security role or equivalent privileges in Microsoft Dynamics CRM Online.
Configure the OnLoad event for the Task form
- In the Navigation Pane, click System Settings, click Customization, and then click Customize Entities.
- From the View list, select Customizable Entities and then from the list, double-click Marketing List. The Entity: Marketing List form opens.
- Under Details, select Forms and Views.
- From the View list, select All Forms and Views; from the list, select and then double-click Form. The Form: Marketing List form opens.
- Select Member Type and then in Common Tasks, click Form Properties. The Form Properties dialog opens.
- In the Event List area, select OnLoad and then click Edit. The Event Detail Properties dialog box opens.
- On the Details tab, select Event is enabled and then, in the field, paste the following code.
var Account = 1;
var Contact = 2;
var Lead = 4;
if (crmForm.all.createdfromcode.DataValue == null)
{
crmForm.all.createdfromcode.DataValue = 4;
}
- Click OK twice, and then on Form: Marketing List click Save and Close.
- On the Entity: Marketing List form, on the Actions menu, click Publish.
Once an integer corresponding to a typecode is selected as the default, when new marketing lists are created, the Member Type default specified (Account = 1, Contact = 2, or Lead = 4) appears in the Member Type drop-down list. Of course, users can still select another type if the default is not correct for any particular list. But having a default specified that is normally the type most users would create, speeds the list creation process and minimizes mistakes and subsequent rework.