A client asked: How can I set a default Member Type in Marketing Lists?
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, 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. The following steps walk you through customizing the Member Type typecode field using an OnLoad event.
Configure the OnLoad event for the Task form
* Click Settings > Click Customization > Click Customize Entities
* Select Customizable Entities > Select Marketing List
* Under Details > Select Forms and Views.
* Select All Forms and Views > Select and then double-click Form
* Select Member Type > Click Form Properties
* Under Events, select OnLoad > Click Edit
* Select Event is enabled and paste the following code:
var Account = 1;
var Contact = 2;
var Lead = 4;
if (crmForm.all.createdfromcode.DataValue == null)
crmForm.all.createdfromcode.DataValue = 4;
* On Marketing List click Save and Close
* On the Entity: Marketing List form, 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.
In the above code, the default is 4 or Lead. If you create a new Marketing List, the Member Type will be auto-populated with Lead. If needed, the type can be changed using the drop-down but by having a default will limit mistakes made in the type of list.