Class EventDataDialogDefinition
Utility class to generate a dialog to use in CRMScript triggers.
Syntax
Constructors
EventDataDialogDefinition()
Initializes a new instance of the EventDataDialogDefinition class.
Declaration
EventDataDialogDefinition
Methods
addCheckbox(String,String)
Adds a checkbox field with given label.
Declaration
Void addCheckbox(String id, String label)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addCheckbox("checkme", "My checkbox");
addCheckbox(String,String,Bool)
Adds a checkbox field with given label. Possible to set field as mandatory.
Declaration
Void addCheckbox(String id, String label, Bool mandatory)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| Bool | mandatory | Setting field to mandatory if true. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addCheckbox("checkme", "My checkbox",true);
addDate(String,String)
Adds a Date field with given label.
Declaration
Void addDate(String id, String label)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addDate("date", "My date");
addDate(String,String,Date)
Adds a Date field with given label and a default value.
Declaration
Void addDate(String id, String label, Date default)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| Date | default | Default value for field. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
Date date;
def.addDate("date", "My date",date);
addDate(String,String,Date,String,Bool)
Adds a Date field with given label, default value, placeholder text. Possible to set field as mandatory.
Declaration
Void addDate(String id, String label, Date default, String placeholder, Bool mandatory)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| Date | default | Default value for field. |
| String | placeholder | Placeholder text. |
| Bool | mandatory | Setting field to mandatory if true. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
Date date;
def.addDate("date", "My date",date, "Input date", true);
addDateTime(String,String)
Adds a DateTime field with given label.
Declaration
Void addDateTime(String id, String label)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addDateTime("datetime", "My datetime");
addDateTime(String,String,DateTime)
Adds a DateTime field with given label and a default value.
Declaration
Void addDateTime(String id, String label, DateTime default)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| DateTime | default | Default value for field. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
DateTime now;
def.addDateTime("datetime", "My datetime",now);
addDateTime(String,String,DateTime,String,Bool)
Adds a DateTime field with given label, default value, placeholder text. Possible to set field as mandatory.
Declaration
Void addDateTime(String id, String label, DateTime default, String placeholder, Bool mandatory)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| DateTime | default | Default value for field. |
| String | placeholder | Placeholder text. |
| Bool | mandatory | Setting field to mandatory if true. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
DateTime now;
def.addDateTime("datetime", "My datetime",now, "Input datetime", true);
addField(EventDataDialogField)
Adds a field to dialog.
Declaration
Void addField(EventDataDialogField field)
Parameters
| Type | Name | Description |
|---|---|---|
| EventDataDialogField | field | Field to add. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
EventDataDialogField dField;
dField.setId("field1");
dField.setType("list");
dField.setLabel("Label 1");
dField.setPlaceholder("Ph field 1");
dField.setListName("associate");
dField.setShowFullPath(false);
dField.setAllowRootSelection(false);
dField.setShowAllChildrenInSearch(true);
dField.setDefault("32");
def.addField(dField);
addFloat(String,String)
Adds a Float field with given label.
Declaration
Void addFloat(String id, String label)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addFloat("floatNumber", "My float");
addFloat(String,String,Float)
Adds a Float field with given label and a default value.
Declaration
Void addFloat(String id, String label, Float defaultValue)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| Float | defaultValue | Default value for field. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addFloat("floatNumber", "My float", 3.14);
addFloat(String,String,Float,String,Bool)
Adds a Float field with given label, default value, placeholder text. Possible to set field as mandatory.
Declaration
Void addFloat(String id, String label, Float defaultValue, String placeholder, Bool mandatory)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| Float | defaultValue | Default value for field. |
| String | placeholder | Placeholder text. |
| Bool | mandatory | Setting field to mandatory if true. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addFloat("floatNumber", "My float", 3.14, "Input decimal number", true);
addInteger(String,String)
Adds a Integer field with given label.
Declaration
Void addInteger(String id, String label)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addInteger("integer", "My Integer");
addInteger(String,String,Integer)
Adds a Integer field with given label and a default value.
Declaration
Void addInteger(String id, String label, Integer defaultValue)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| Integer | defaultValue | Default value for field. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addInteger("integer", "My Integer", 3);
addInteger(String,String,Integer,String,Bool)
Adds a Integer field with given label, default value, placeholder text. Possible to set field as mandatory.
Declaration
Void addInteger(String id, String label, Integer defaultValue, String placeholder, Bool mandatory)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| Integer | defaultValue | Default value for field. |
| String | placeholder | Placeholder text. |
| Bool | mandatory | Setting field to mandatory if true. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addInteger("integer", "My Integer", 3, "Input number", true);
addLabel(String,String)
Adds a label field.
Declaration
Void addLabel(String id, String label)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addLabel("label1", "My label");
addList(String,String,String)
Adds a list field from listName with the given label.
Declaration
Void addList(String id, String label, String listName)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| String | listName | List name. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addList("listAssociate", "Choose associate", "associate");
addList(String,String,String,Integer)
Adds a list field from listname with given label and default value.
Declaration
Void addList(String id, String label, String listName, Integer defaultValue)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| String | listName | List name. |
| Integer | defaultValue | Default value for field. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addList("listAssociate", "Choose associate", "associate", 1);
addList(String,String,String,Integer,String,Bool)
Adds a list field from listname with given label, default value, placeholder text. Possible to set field as mandatory.
Declaration
Void addList(String id, String label, String listName, Integer defaultValue, String placeholder, Bool mandatory)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| String | listName | List name. |
| Integer | defaultValue | Default value for field. |
| String | placeholder | Placeholder text. |
| Bool | mandatory | Setting field to mandatory if true. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addList("listAssociate", "Choose associate", "associate", 1, "Select from list", false);
addList(String,String,String[],String,String,Bool)
Adds a list field from manually created list with given label, default value, placeholder text. Possible to set field as mandatory.
Declaration
Void addList(String id, String label, String[] listItems, String defaultValue, String placeholder, Bool mandatory)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| String[] | listItems | String array of items. |
| String | defaultValue | Default value for field. |
| String | placeholder | Placeholder text. |
| Bool | mandatory | Setting field to mandatory if true. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
String[2] items;
items[0] = "Value 1";
items[1] = "Value 2";
def.addList("listItems", "Choose item", items, "", "Select from list", false);
addList(String,String,Map,String,String,Bool)
Adds a list field from manually created list with key-value pair with given label, default value, placeholder text. Possible to set field as mandatory.
Declaration
Void addList(String id, String label, Map listItems, String defaultValue, String placeholder, Bool mandatory)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| Map | listItems | Map of key-value pairs. |
| String | defaultValue | Default value for field. |
| String | placeholder | Placeholder text. |
| Bool | mandatory | Setting field to mandatory if true. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
Map items;
items.insert("1""Value 1");
items.insert("2","Value 2");
def.addList("listItems", "Choose item", items, "", "Select from list", false);
addList(String,String,String,Integer,String,Bool,String,Bool)
Adds a list field from listname with given label, default value, placeholder text. Possible to set additionalInfo supported by list and force list to be flat. Possible to set field as mandatory.
Declaration
Void addList(String id, String label, String listName, Integer defaultValue, String placeholder, Bool mandatory, String additionalInfo, Bool forceFlatList)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| String | listName | List name. |
| Integer | defaultValue | Default value for field. |
| String | placeholder | Placeholder text. |
| Bool | mandatory | Setting field to mandatory if true, |
| String | additionalInfo | Additional info parameters supported by specified list. |
| Bool | forceFlatList | If true will return list without hierarchical structure. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addList("listAssociate", "Choose associate", "associate", 1, "Select from list", false, "", false);
addText(String,String)
Adds a text field with given label.
Declaration
Void addText(String id, String label)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addText("textinput", "My Input");
addText(String,String,String)
Adds a text field with given label and a default value.
Declaration
Void addText(String id, String label, String defaultValue)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| String | defaultValue | Default value for field. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addText("textinput", "My Input", "Default");
addText(String,String,String,String,Bool)
Adds a text field with given label, default value, placeholder text. Possible to set field as mandatory.
Declaration
Void addText(String id, String label, String defaultValue, String placeholder, Bool mandatory)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| String | defaultValue | Default value for field. |
| String | placeholder | Placeholder text. |
| Bool | mandatory | Setting field to mandatory if true. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addText("textinput", "My Input", "Default", "Type something", false);
addTextarea(String,String,String,String,Bool,Integer,Integer)
Adds a textarea field with given label, default value, placeholder text, rows and columns. Possible to set field as mandatory.
Declaration
Void addTextarea(String id, String label, String defaultValue, String placeholder, Bool mandatory, Integer rows, Integer cols)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| String | defaultValue | Default value for field. |
| String | placeholder | Placeholder text. |
| Bool | mandatory | Setting field to mandatory if true. |
| Integer | rows | Setting how many rows. |
| Integer | cols | Setting how many columns. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addText("textinput", "My Input", "Default", "Type something", false,"4","5");
addTime(String,String)
Adds a Time field with given label.
Declaration
Void addTime(String id, String label)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addTime("time", "My time");
addTime(String,String,Time)
Adds a Time field with given label and a default value.
Declaration
Void addTime(String id, String label, Time default)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| Time | default | Default value for field. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
Time now;
def.addTime("time", "My time",now);
addTime(String,String,Time,String,Bool)
Adds a Time field with given label, default value, placeholder text. Possible to set field as mandatory.
Declaration
Void addTime(String id, String label, Time default, String placeholder, Bool mandatory)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| Time | default | Default value for field. |
| String | placeholder | Placeholder text. |
| Bool | mandatory | Setting field to mandatory if true. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
Time now;
def.addTime("time", "My time",now, "Input time", true);
addTimeSpan(String,String)
Adds a TimeSpan field with given label.
Declaration
Void addTimeSpan(String id, String label)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.addTimeSpan("timespane", "My timespan");
addTimeSpan(String,String,Integer)
Adds a TimeSpan field with given label and a default value.
Declaration
Void addTimeSpan(String id, String label, Integer default)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| Integer | default | Default value for field. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
Integer default = 100;
def.addTimeSpan("timespan", "My timespan", default);
addTimeSpan(String,String,Integer,String,Bool)
Adds a TimeSpan field with given label, default value, placeholder text. Possible to set field as mandatory.
Declaration
Void addTimeSpan(String id, String label, Integer default, String placeholder, Bool mandatory)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| Integer | default | Default value for field. |
| String | placeholder | Placeholder text. |
| Bool | mandatory | Setting field to mandatory if true. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
Integer default = 100;
def.addTimeSpan("timespan", "My timespan",default, "Input timespan", true);
addTimeSpan(String,String,Integer,String,Bool,Bool,Bool,Bool,Bool,Bool)
Adds a TimeSpan field with given label, default value, placeholder text and which units to display. Possible to set field as mandatory.
Declaration
Void addTimeSpan(String id, String label, Integer default, String placeholder, Bool mandatory, Bool allowBlank, Bool days, Bool hours, Bool minutes, Bool seconds)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
| String | label | Field label. |
| Integer | default | Default value for field. |
| String | placeholder | Placeholder text. |
| Bool | mandatory | Setting field to mandatory if true. |
| Bool | allowBlank | Allowing field to be empty instead of 0. |
| Bool | days | Field displays days. |
| Bool | hours | Field displays hours. |
| Bool | minutes | Field displays minutes. |
| Bool | seconds | Field displays seconds. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
Integer default = 100;
def.addTimeSpan("timespan", "My timespan",default, "Input timespan", true,true,false,true,true,false);
getBlockExecutionOnCancel()
Returns true if execution is blocked on cancel.
Declaration
Bool getBlockExecutionOnCancel()
Returns
| Type | Description |
|---|---|
| Bool |
getHeight()
Get height set on dialog.
Declaration
Integer getHeight()
Returns
| Type | Description |
|---|---|
| Integer |
getIcon()
Returns type of icon on dialog
Declaration
String getIcon()
Returns
| Type | Description |
|---|---|
| String |
Remarks
Supports:
- info
- warn
- error
- question
getMarkdown()
Returns body text with Markdown syntax.
Declaration
String getMarkdown()
Returns
| Type | Description |
|---|---|
| String |
getPrefix()
Returns prefix set for fields dialog
Declaration
String getPrefix()
Returns
| Type | Description |
|---|---|
| String |
getText()
Returns body text on dialog
Declaration
String getText()
Returns
| Type | Description |
|---|---|
| String |
getTitle()
Returns title on dialog
Declaration
String getTitle()
Returns
| Type | Description |
|---|---|
| String |
getType()
Returns what type of dialog
Declaration
String getType()
Returns
| Type | Description |
|---|---|
| String |
Remarks
Supports:
- yesno
- okcancel
getWidth()
Get width set on dialog.
Declaration
Integer getWidth()
Returns
| Type | Description |
|---|---|
| Integer |
removeField(String)
Remove field with given name.
Declaration
Void removeField(String id)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | Field identifier. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.removeField("checkme");
setBlockExecutionOnCancel(Bool)
Set if execution should be blocked on cancel.
Declaration
Void setBlockExecutionOnCancel(Bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| Bool | value | Setting value to true will block execution when cancelling dialog. |
Returns
| Type | Description |
|---|---|
| Void |
setHeight(Integer)
Set height of dialog.
Declaration
Void setHeight(Integer height)
Parameters
| Type | Name | Description |
|---|---|---|
| Integer | height | Value for height. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.setHeight(200);
setIcon(String)
Sets icon type on dialog.
Declaration
Void setIcon(String value)
Parameters
| Type | Name | Description |
|---|---|---|
| String | value |
Returns
| Type | Description |
|---|---|
| Void |
Remarks
Supports:
- info
- warn
- error
- question
Examples
EventDataDialogDefinition def;
def.setIcon("info");
setMarkdown(String)
Sets body text using Markdown syntax on dialog. If specified this will take precedence over setText().
Declaration
Void setMarkdown(String value)
Parameters
| Type | Name | Description |
|---|---|---|
| String | value | Sets body text using Markdown syntax on dialog. |
Returns
| Type | Description |
|---|---|
| Void |
Remarks
NOTE: This is not full Markdown but a "lite" version.
- # - Produces a <h1>
- Newline in current paragraph - adds a <br>
- Blank line - starts a new paragraph. Multiple blank lines in a row will create empty paragraphs.
- Leading * - replaced with •
- Whitelisted tags are preserved (b, i, a, span, p).
- Whitelisted attributes are preserved (class). To get a section styled differently, you may use a span element with a custom class name.
Examples
EventDataDialogDefinition def;
def.setMarkdown("[Google it](https://www.google.com)");
setPrefix(String)
Sets prefix for fields in dialog.
Declaration
Void setPrefix(String value)
Parameters
| Type | Name | Description |
|---|---|---|
| String | value | Sets prefix on all fields. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.setPrefix("info_");
setText(String)
Sets body text on dialog.
Declaration
Void setText(String value)
Parameters
| Type | Name | Description |
|---|---|---|
| String | value | Sets body text on dialog. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.setText("My dialog body");
setTitle(String)
Sets title on dialog.
Declaration
Void setTitle(String value)
Parameters
| Type | Name | Description |
|---|---|---|
| String | value | Sets title on dialog. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.setTitle("My dialog title");
setType(String)
Sets type of dialog.
Declaration
Void setType(String type)
Parameters
| Type | Name | Description |
|---|---|---|
| String | type | Sets type on dialog. |
Returns
| Type | Description |
|---|---|
| Void |
Remarks
Supports:
- yesno
- okcancel
Examples
EventDataDialogDefinition def;
def.setType("yesno");
setWidth(Integer)
Set width of dialog.
Declaration
Void setWidth(Integer height)
Parameters
| Type | Name | Description |
|---|---|---|
| Integer | height | Value for width. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
EventDataDialogDefinition def;
def.setWidth(200);
toJSONString()
Returns EventDataDialogDefinition as a JSON string.
Declaration
String toJSONString()
Returns
| Type | Description |
|---|---|
| String | Returns object as a JSON string. |
Examples
EventDataDialogDefinition def;
def.addCheckbox("checkbox_1", "Checkbox 1");
def.addCheckbox("checkbox_2", "Checkbox 2", true);
def.addText("text_1", "Text 1", "Default", "Placeholder", true);
def.addList("list_1", "List 1", "personList", 42);
print(def.toJSONString());