Defining selectFormat Functions

Learn to define selectFormat function.

The selectFormat function provides the user with the possibility to select one or more formats (e.g. phone profile, trigger, query, default values etc). Define a Select-Function selectFormat for the desired field.

Example: In the Telephone Profiles field in the Rep info area (ID) users can select one or more phone profiles.
selectFormat({
  formatType: 48,
  includePublicFormats: true,
  selectionMode: "multi"
});

Syntax

Name

Type

Description

fieldId

int or string

The unique field ID or XML name of the field to which the format name is copied. (default: fieldId for which this formatSelector is defined)

formatType

int

The number representing the type of formats to select from.

You can find the format numbers in the mm_fixcatno_custom.txt file (created by starting mmba.exe with the --writeres parameter, >> mmba.exe Parameters in the CRM.Core Administrator Guide): catalog no. 36 "Type (Format)".

includePrivateFormats

bool

If true formats from the current user are shown. (default: true)

includePublicFormats

bool

If true formats from other users are shown. (default: false)

filter

string

The info area abbreviation for which a format should be shown (e.g. "MA" to list only formats defined for the Activity info area)

filterFieldId

int or string

The unique field ID or XML name of the field that contains the info area abbreviation by which to filter. Only applied when filter is not set. Only formats defined for that info area is available. (Example in UPDATE_DEFAULT: Used for selecting the correct default values format in Question (F2) field Default Values.

formatName

string

The initially selected format(s). In case of multiselect the format names have to be semicolon-separated. (default: currently entered value of the field with id fieldId)

filterFormatName

string

An optional string used for filtering the format by name (wildcards are supported), e.g. "My*" to list only formats whose name starts with "My".

selectionMode

string

If set to "multi" multiple formats can be selected.

Examples

To select a private query format (i.e. owned by the current user):
selectFormat({
  formatType: 32
});
To select private and public formats of type "DefaultValuesForInfoAreas" defined for the Activity info area (MA):
selectFormat({
  formatType: 36,
  includePublicFormats: true,
  filter: "MA"
});
To select multiple private and public formats of type "DefaultValuesForInfoAreas" defined for the info area entered in field no. 5:
selectFormat({
  formatType: 36,
  includePublicFormats: true,
  filterFieldId: 5,
  selectionMode: "multi"
});