Class EventDataDialogDefinition
Utility class to generate a dialog to use in CRMScript triggers.
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) Examples
EventDataDialogDefinition def;
def.addCheckbox("checkme", "My checkbox");
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
| Void |
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) Examples
EventDataDialogDefinition def;
def.addCheckbox("checkme", "My checkbox",true);
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
| Bool | mandatory | Setting field to mandatory if true. |
Returns
| Type | Description |
| Void |
addDate(String,String)
Adds a Date field with given label.
Declaration
Void addDate(String id, String label) Examples
EventDataDialogDefinition def;
def.addDate("date", "My date");
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
| Void |
addDate(String,String,Date)
Adds a Date field with given label and a default value.
Declaration
Void addDate(String id, String label, Date default) Examples
EventDataDialogDefinition def;
Date date;
def.addDate("date", "My date",date);
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
| Date | default | Default value for field. |
Returns
| Type | Description |
| Void |
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) Examples
EventDataDialogDefinition def;
Date date;
def.addDate("date", "My date",date, "Input date", true);
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 |
addDateTime(String,String)
Adds a DateTime field with given label.
Declaration
Void addDateTime(String id, String label) Examples
EventDataDialogDefinition def;
def.addDateTime("datetime", "My datetime");
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
| Void |
addDateTime(String,String,DateTime)
Adds a DateTime field with given label and a default value.
Declaration
Void addDateTime(String id, String label, DateTime default) Examples
EventDataDialogDefinition def;
DateTime now;
def.addDateTime("datetime", "My datetime",now);
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
| DateTime | default | Default value for field. |
Returns
| Type | Description |
| Void |
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) Examples
EventDataDialogDefinition def;
DateTime now;
def.addDateTime("datetime", "My datetime",now, "Input datetime", true);
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 |
addField(EventDataDialogField)
Adds a field to dialog.
Declaration
Void addField(EventDataDialogField field) 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);
Parameters
| Type | Name | Description |
| EventDataDialogField | field | Field to add. |
Returns
| Type | Description |
| Void |
addFloat(String,String)
Adds a Float field with given label.
Declaration
Void addFloat(String id, String label) Examples
EventDataDialogDefinition def;
def.addFloat("floatNumber", "My float");
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
| Void |
addFloat(String,String,Float)
Adds a Float field with given label and a default value.
Declaration
Void addFloat(String id, String label, Float defaultValue) Examples
EventDataDialogDefinition def;
def.addFloat("floatNumber", "My float", 3.14);
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
| Float | defaultValue | Default value for field. |
Returns
| Type | Description |
| Void |
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) Examples
EventDataDialogDefinition def;
def.addFloat("floatNumber", "My float", 3.14, "Input decimal number", true);
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 |
addInteger(String,String)
Adds a Integer field with given label.
Declaration
Void addInteger(String id, String label) Examples
EventDataDialogDefinition def;
def.addInteger("integer", "My Integer");
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
| Void |
addInteger(String,String,Integer)
Adds a Integer field with given label and a default value.
Declaration
Void addInteger(String id, String label, Integer defaultValue) Examples
EventDataDialogDefinition def;
def.addInteger("integer", "My Integer", 3);
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
| Integer | defaultValue | Default value for field. |
Returns
| Type | Description |
| Void |
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) Examples
EventDataDialogDefinition def;
def.addInteger("integer", "My Integer", 3, "Input number", true);
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 |
addLabel(String,String)
Adds a label field.
Declaration
Void addLabel(String id, String label) Examples
EventDataDialogDefinition def;
def.addLabel("label1", "My label");
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
| Void |
addList(String,String,String)
Adds a list field from listName with the given label.
Declaration
Void addList(String id, String label, String listName) Examples
EventDataDialogDefinition def;
def.addList("listAssociate", "Choose associate", "associate");
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
| String | listName | List name. |
Returns
| Type | Description |
| Void |
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) Examples
EventDataDialogDefinition def;
def.addList("listAssociate", "Choose associate", "associate", 1);
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 |
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) Examples
EventDataDialogDefinition def;
def.addList("listAssociate", "Choose associate", "associate", 1, "Select from list", false);
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 |
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) Examples
EventDataDialogDefinition def;
String[2] items;
items[0] = "Value 1";
items[1] = "Value 2";
def.addList("listItems", "Choose item", items, "", "Select from list", false);
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 |
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) 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);
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 |
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) Examples
EventDataDialogDefinition def;
def.addList("listAssociate", "Choose associate", "associate", 1, "Select from list", false, "", false);
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 |
addText(String,String)
Adds a text field with given label.
Declaration
Void addText(String id, String label) Examples
EventDataDialogDefinition def;
def.addText("textinput", "My Input");
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
| Void |
addText(String,String,String)
Adds a text field with given label and a default value.
Declaration
Void addText(String id, String label, String defaultValue) Examples
EventDataDialogDefinition def;
def.addText("textinput", "My Input", "Default");
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
| String | defaultValue | Default value for field. |
Returns
| Type | Description |
| Void |
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) Examples
EventDataDialogDefinition def;
def.addText("textinput", "My Input", "Default", "Type something", false);
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 |
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) Examples
EventDataDialogDefinition def;
def.addText("textinput", "My Input", "Default", "Type something", false,"4","5");
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 |
addTime(String,String)
Adds a Time field with given label.
Declaration
Void addTime(String id, String label) Examples
EventDataDialogDefinition def;
def.addTime("time", "My time");
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
| Void |
addTime(String,String,Time)
Adds a Time field with given label and a default value.
Declaration
Void addTime(String id, String label, Time default) Examples
EventDataDialogDefinition def;
Time now;
def.addTime("time", "My time",now);
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
| Time | default | Default value for field. |
Returns
| Type | Description |
| Void |
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) Examples
EventDataDialogDefinition def;
Time now;
def.addTime("time", "My time",now, "Input time", true);
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 |
addTimeSpan(String,String)
Adds a TimeSpan field with given label.
Declaration
Void addTimeSpan(String id, String label) Examples
EventDataDialogDefinition def;
def.addTimeSpan("timespane", "My timespan");
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
Returns
| Type | Description |
| Void |
addTimeSpan(String,String,Integer)
Adds a TimeSpan field with given label and a default value.
Declaration
Void addTimeSpan(String id, String label, Integer default) Examples
EventDataDialogDefinition def;
Integer default = 100;
def.addTimeSpan("timespan", "My timespan", default);
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
| String | label | Field label. |
| Integer | default | Default value for field. |
Returns
| Type | Description |
| Void |
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) Examples
EventDataDialogDefinition def;
Integer default = 100;
def.addTimeSpan("timespan", "My timespan",default, "Input timespan", true);
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 |
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) Examples
EventDataDialogDefinition def;
Integer default = 100;
def.addTimeSpan("timespan", "My timespan",default, "Input timespan", true,true,false,true,true,false);
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 |
removeField(String)
Remove field with given name.
Declaration
Void removeField(String id) Examples
EventDataDialogDefinition def;
def.removeField("checkme");
Parameters
| Type | Name | Description |
| String | id | Field identifier. |
Returns
| Type | Description |
| Void |
getBlockExecutionOnCancel()
Returns true if execution is blocked on cancel.
Declaration
Bool getBlockExecutionOnCancel() Returns
| Type | Description |
| Bool |
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 |
getHeight()
Get height set on dialog.
Declaration
Integer getHeight() Returns
| Type | Description |
| Integer |
setHeight(Integer)
Set height of dialog.
Declaration
Void setHeight(Integer height) Examples
EventDataDialogDefinition def;
def.setHeight(200);
Parameters
| Type | Name | Description |
| Integer | height | Value for height. |
Returns
| Type | Description |
| Void |
getIcon()
Returns type of icon on dialog
Declaration
String getIcon() Returns
| Type | Description |
| String |
setIcon(String)
Sets icon type on dialog.
Declaration
Void setIcon(String value) Examples
EventDataDialogDefinition def;
def.setIcon("info");
Parameters
| Type | Name | Description |
| String | value |
Returns
| Type | Description |
| Void |
getMarkdown()
Returns body text with Markdown syntax.
Declaration
String getMarkdown() Returns
| Type | Description |
| String |
setMarkdown(String)
Sets body text using Markdown syntax on dialog. If specified this will take precedence over setText().
Declaration
Void setMarkdown(String value) Examples
EventDataDialogDefinition def;
def.setMarkdown("[Google it](https://www.google.com)");
Parameters
| Type | Name | Description |
| String | value | Sets body text using Markdown syntax on dialog. |
Returns
| Type | Description |
| Void |
getPrefix()
Returns prefix set for fields dialog
Declaration
String getPrefix() Returns
| Type | Description |
| String |
setPrefix(String)
Sets prefix for fields in dialog.
Declaration
Void setPrefix(String value) Examples
EventDataDialogDefinition def;
def.setPrefix("info_");
Parameters
| Type | Name | Description |
| String | value | Sets prefix on all fields. |
Returns
| Type | Description |
| Void |
setText(String)
Sets body text on dialog.
Declaration
Void setText(String value) Examples
EventDataDialogDefinition def;
def.setText("My dialog body");
Parameters
| Type | Name | Description |
| String | value | Sets body text on dialog. |
Returns
| Type | Description |
| Void |
setTitle(String)
Sets title on dialog.
Declaration
Void setTitle(String value) Examples
EventDataDialogDefinition def;
def.setTitle("My dialog title");
Parameters
| Type | Name | Description |
| String | value | Sets title on dialog. |
Returns
| Type | Description |
| Void |
setType(String)
Sets type of dialog.
Declaration
Void setType(String type) Examples
EventDataDialogDefinition def;
def.setType("yesno");
Parameters
| Type | Name | Description |
| String | type | Sets type on dialog. |
Returns
| Type | Description |
| Void |
setWidth(Integer)
Set width of dialog.
Declaration
Void setWidth(Integer height) Examples
EventDataDialogDefinition def;
def.setWidth(200);
Parameters
| Type | Name | Description |
| Integer | height | Value for width. |
Returns
| Type | Description |
| Void |
toJSONString()
Returns EventDataDialogDefinition as a JSON string.
Declaration
String toJSONString() 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());
Returns
| Type | Description |
| String | Returns object as a JSON string. |