fields Methods
Item Index
Methods
addIcon
(
-
field
-
img
-
elemId
)
-
field
-
img
-
elemId
Adds an icon to a field.
Parameters:
Returns:
Object
Examples:
// Adds the Default.gif icon to the user_invited field.
crm("user_invited").addIcon("../Themes/Img/Default.gif");
// Adds the Default.gif icon to the user_invited field and creates an ID for the icon.
crm("user_invited").addIcon("../Themes/Img/Default.gif", "elemId");
appendIconToCaption
(
-
obj
)
deprecated
-
obj
Adds an icon to a field caption.
Parameters:
-
obj
ObjectSpecifies the icon to add in the form of a JSON object.
Returns:
Nothing
Examples:
// Adds the icon from the min.gif file to the caption of the case_problemnote field.
crm.fields("case_problemnote").appendIconToCaption({ id : this.name + "_popUpImg",
src : "../Themes/Img/Color/Buttons/min.gif", height:"15",width:"15", click:function(){alert(1)}})
background
(
-
color
)
-
color
Sets the background color of a field caption.
Parameters:
Returns:
Object
Examples:
// Sets the background color of the case_problemnote field caption to yellow.
crm.fields("case_problemnote").caption().background();
// Sets the background color of the case_problemnote field caption to red.
crm.fields("case_problemnote").caption().background("red");
// Removes background color from the case_problemnote field caption.
crm.fields("case_problemnote").caption().background(false);
bold
(
-
remove
)
-
remove
Displays a field value in bold font.
Parameters:
-
remove
BooleanWhen this parameter is empty, the field value is displayed in bold font.
When this parameter is set to false, the field value is displayed in normal font.
Returns:
Object
Examples:
// Sets the font weight of the case_problemnote field value to bold.
crm.fields("case_problemnote").caption().bold();
// Sets the font weight of the case_problemnote field value to normal.
crm.fields("case_problemnote").caption().bold(false);
collapse
()
Collapses a hidden field and moves a visible field in its place to save up screen space.
Returns:
Object
Examples:
// Collapses the case_problemtype field.
crm.fields("case_problemtype").collapse()
color
(
-
obj
)
-
obj
Sets a custom color for a field value.
Parameters:
Returns:
Object
Examples:
// Sets the color of the case_problemnote field value to red.
crm.fields("case_problemnote").caption().color("red");
// Sets the color of the case_problemnote field value to black.
crm.fields("case_problemnote").caption().color(false);
fadeIn
()
Slowly shows a field and its value on the user interface.
Returns:
Object
Examples:
// Slowly shows the case_problemnote field and its value on the user interface.
crm.fields("case_problemnote").fadeIn();
fadeOut
(
-
obj
)
-
obj
Slowly hides a field and its caption on the user interface.
Parameters:
-
obj
BooleanWhen this parameter is empty, the field and its caption slowly disappear.
When this parameter is set to false, the field and its caption are shown.
Returns:
Object
Examples:
// Shows the case_problemnote field and its caption on the user interface.
crm.fields("case_problemnote").fadeOut(false);
// Causes the case_problemnote field and its caption to disappear slowly from the user interface.
crm.fields("case_problemnote").fadeOut();
fields
(
-
fieldName
)
-
fieldName
Gets values of the specified fields.
Parameters:
-
fieldName
String | | NullSpecifies the names of the fields.
Returns:
Object
Examples:
// Returns the value of the comp_name field.
crm.fields('comp_name')
// Returns values of all fields except comp_name.
crm.fields('!comp_name')
// Returns values of all fields except comp_name and comp_description.
crm.fields('!comp_name !comp_description')
// Returns values of all fields.
crm.fields()
fontSize
(
-
obj
)
-
obj
Sets the font size (in pixels) of a field value.
Parameters:
Returns:
Object
Examples:
// Sets the font size for the case_problemnote field value to 20 pixels.
crm.fields("case_problemnote").caption().fontSize(20);
hide
(
-
obj
)
-
obj
Hides a field and its value on the user interface.
Parameters:
-
obj
BooleanWhen this parameter is empty, the field and its value are hidden.
When this parameter is set to false, the field and its value are shown.
Returns:
Object
Examples:
// Hides the case_problemnote field and its value.
crm.fields("case_problemnote").caption().hide();
// Displays the case_problemnote field and its value.
crm.fields("case_problemnote").caption().hide(false);
highlight
(
-
obj
)
-
obj
Highlights a field value in the specified color.
Parameters:
Returns:
Object
Examples:
// Highlights the value of the oppo_description field in yellow.
crm.fields("oppo_description").highlight();
// Highlights the value of the oppo_description field in red.
crm.fields("oppo_description").highlight("red");
// Removes the highlight from the oppo_description field value.
crm.fields("oppo_description").highlight(false);
hint
(
-
obj
)
-
obj
Sets a tooltip on a field value.
Parameters:
-
obj
StringSpecifies the tooltip text.
Returns:
Object
Examples:
// Sets the tooltip "This is a sample tooltip." on the value of the case_problemnote field.
crm.fields("case_problemnote").hint("This is a sample tooltip.");
inputSize
(
-
obj
)
deprecated
-
obj
Sets the input size of a given field. This method only works for single-line text fields in edit mode.
Parameters:
-
obj
NumberSpecifies the field input size (in characters).
Returns:
Object
Examples:
// Sets the input size of the case_description field to 5 characters.
crm.fields("case_description").inputSize("5");
italic
(
-
obj
)
-
obj
Italicizes the font of a field value.
Parameters:
-
obj
BooleanWhen this parameter is empty, the field value is displayed in italic font.
When this parameter is set to false, the field value is displayed in normal font.
Returns:
Object
Examples:
// Italicizes the value of the case_problemnote field.
crm.fields("case_problemnote").caption().hide();
// Displays the value of the case_problemnote field in normal font.
crm.fields("case_problemnote").caption().italic(false);
maxLength
(
-
obj
)
-
obj
Sets the maximum length of a field value.
Parameters:
-
obj
NumberSpecifies the maximum field value length in characters.
The value in this parameter cannot exceed the default maximum length defined for the field value.
Returns:
Object
Examples:
// Sets the maximum length of the case_description field value to 50 characters.
crm.fields("case_description").maxLength("50");
minimise
(
-
obj
)
-
obj
Adds a link to the bottom of a text field allowing a user to expand or collapse the field value.
This method works in view mode only.
Parameters:
-
obj
NumberSpecifies the height (in pixels) to which the text field value is collapsed.
Returns:
Object
Examples:
// Adds a collapse/expand link to the bottom of the case_problemnote field.
// When that field value is collapsed, its height is 15 pixels.
crm.fields("case_problemnote").minimise(15);
overline
(
-
obj
)
-
obj
Adds a line above a field value.
Parameters:
-
obj
BooleanWhen this parameter is empty, there is a line above the field value.
When this parameter is set to false, there is no line above the field value.
Returns:
Object
Examples:
// Adds a line above the value of the case_problemnote field.
crm.fields("case_problemnote").caption().overline();
show
(
-
remove
)
-
remove
Shows a field value that has been hidden.
Parameters:
-
remove
BooleanWhen this parameter is empty, the field value is shown.
When this parameter is set to false, the field value is hidden.
Returns:
Object
Examples:
// Shows the value of the case_problemnote field on the user interface.
crm.fields("case_problemnote").show();
strike
(
-
obj
)
-
obj
Adds a line through the middle of a field value.
Parameters:
-
obj
BooleanWhen this parameter is empty, there is a line through the middle of the field value.
When this parameter is set to false, there is no line through the middle of the field value.
Returns:
Object
Examples:
// Adds a line through the middle of the case_problemnote field value.
crm.fields("case_problemnote").caption().strike();
title
(
-
obj
)
deprecated
-
obj
Sets the tooltip of a field.
Parameters:
-
obj
StringSpecifies the tooltip text to set.
Returns:
Object
Examples:
// Sets the tooltip of the case_problemnote field to "This is my tooltip text."
crm.fields("case_problemnote").title("This is my tooltip text.");
underline
(
-
obj
)
-
obj
Adds a line under a field value.
Parameters:
-
obj
BooleanWhen this parameter is empty, there is a line under the field value.
When this parameter is set to false, there is no line under the field value.
Returns:
Object
Examples:
// Adds a line under the value of the case_problemnote field.
crm.fields("case_problemnote").underline();
urlToImage
(
-
options
)
-
options
Displays an image for a URL value.
Parameters:
Returns:
Object
Examples:
// Uses the value of the field as the source of the image.
crm.fields("prod_url").urlToImage();
// Creates an image using the specified source.
crm.fields("comp_name").urlToImage({src:"../Themes/Img/Color1/Buttons/min.gif"});
// Creates an image using the specified source and click event.
crm.fields("comp_name").urlToImage({src:"../Themes/Img/Color1/Buttons/min.gif",
click : function(){alert(1)}});
val
(
-
val
)
-
val
Sets the value of a specified field. This method only works in edit mode.
Returns:
String
Examples:
//Gets the value of the comp_name field
crm.fields("comp_name").val();
// Sets the value of the comp_name field value to ACME Inc.
crm.fields("comp_name").val("ACME Inc.");
// Sets the value of the oppo_priority field value to High.
crm.fields("oppo_priority").val("High");
// Sets the oppo_targetclose field value to one week from now.
var oneWeekFromNow = new Date();
oneWeekFromNow.setDate(oneWeekFromNow.getDate() + 7);
crm.fields("oppo_targetclose").val(oneWeekFromNow);
value
()
Gets or sets the value of a selected field. Setting the value only works in edit mode.
Returns:
String | Number | Date
Returned value depends on the field type.
Examples:
// Gets the value of the comp_name field.
crm.fields("comp_name").value();
// Sets the comp_name field value to ACME Inc.
crm.fields("comp_name").value("ACME Inc.");
// Sets the oppo_priority field value to High.
crm.fields("oppo_priority").value("High");
// Sets the oppo_targetclose field value to one week from now.
var oneWeekFromNow = new Date();
oneWeekFromNow.setDate(oneWeekFromNow.getDate() + 7);
crm.fields("oppo_targetclose").value(oneWeekFromNow)