public class

PreChatField

extends ChatUserData
java.lang.Object
   ↳ com.salesforce.android.chat.core.model.ChatUserData
     ↳ com.salesforce.android.chat.core.model.PreChatField

This class is deprecated.
Deprecated in favor of ChatUserData

Class Overview

Class which describes a PreChatField as configured for snap-ins in your salesforce organization.

Summary

Nested Classes
class PreChatField.Builder This class is deprecated. Deprecated in favor of ChatUserData.  
class PreChatField.PickListOption Represent a PickList option as a serializable tuple. 
@interface PreChatField.Type  
Constants
String EMAIL
String PHONE
String PICKLIST
String STRING
Public Methods
String getDisplayName()
This is the display name which should be used if displaying this input to a user.
String getExtraTypeInfo()
Supplies additional information which describes the function of the field.
String getFieldName()
This method is deprecated. Construct a ChatUserData object and use {getAgentLabel()} instead.
Integer getMaxValueLength()
The expected maximum length of the field.
List<PreChatField.PickListOption> getPickListOptions()
Return the currently configured picklist option.
int getSelectedPickListIndex()
Returns the currently selected index from the picklist.
String[] getTranscriptFields()
This method is deprecated. Construct a ChatUserData object and use {getTranscriptFieldNames() instead.
String getType()
Returns the input type of the field.
Boolean isHidden()
Returns whether or not this field should be hidden from the UI.
boolean isPickListItemSelected()
Whether or not a picklist item has been selected.
Boolean isReadOnly()
Whether this field is writable.
Boolean isRequired()
Whether this field should be considered required.
Boolean isSatisfied()
A field is satisfied if it is either read only, not required, or otherwise meets the following criteria:
  1. It is a text-based field and its length is less than the max length and its value is greater than zero
  2. It is a a picklist and the selected index has been set
void setSelectedPickListIndex(int index)
Sets a selected index for the picklist options.
void setValue(Serializable value)
Sets the value for this field.
void unsetSelectedPickListIndex()
Resets the current picklist selection value.
[Expand]
Inherited Methods
From class com.salesforce.android.chat.core.model.ChatUserData
From class java.lang.Object

Constants

public static final String EMAIL

Constant Value: "email"

public static final String PHONE

Constant Value: "phone"

public static final String PICKLIST

Constant Value: "picklist"

public static final String STRING

Constant Value: "string"

Public Methods

public String getDisplayName ()

This is the display name which should be used if displaying this input to a user.

Returns
  • the display name which should be used if displaying this input to a user.

public String getExtraTypeInfo ()

Supplies additional information which describes the function of the field.

Returns
  • Additional information about the field.

public String getFieldName ()

This method is deprecated.
Construct a ChatUserData object and use {getAgentLabel()} instead.

public Integer getMaxValueLength ()

The expected maximum length of the field.

Returns
  • The maximum length of the field.

public List<PreChatField.PickListOption> getPickListOptions ()

Return the currently configured picklist option. The first value is the label applied to the option, the second value is what is what should be set to the value of the field if selected.

Returns
  • The current list of picklist options.

public int getSelectedPickListIndex ()

Returns the currently selected index from the picklist. If this option is not a picklist then this value is the default unselected value of -1.

Returns
  • The current selected index for the picklist.

public String[] getTranscriptFields ()

This method is deprecated.
Construct a ChatUserData object and use {getTranscriptFieldNames() instead.

Get an array of Live Chat Transcript Field API Names that the value stored in this field will be mapped to.

Returns
  • An array of Live Chat Transcript Field API Names to map this field to.

public String getType ()

Returns the input type of the field. This is used as a guide for how to present the field the the user.

Returns

public Boolean isHidden ()

Returns whether or not this field should be hidden from the UI.

public boolean isPickListItemSelected ()

Whether or not a picklist item has been selected.

Returns
  • True if selected.

public Boolean isReadOnly ()

Whether this field is writable.

Returns
  • If this field is writable or not.

public Boolean isRequired ()

Whether this field should be considered required. If this is required then the value should be non null. This is an expectation on the nature of the field and is not enforced by this class.

Returns
  • Whether the field should be considered as a required field.

public Boolean isSatisfied ()

A field is satisfied if it is either read only, not required, or otherwise meets the following criteria:

  1. It is a text-based field and its length is less than the max length and its value is greater than zero
  2. It is a a picklist and the selected index has been set

Returns
  • Whether this field has been satisfied.

public void setSelectedPickListIndex (int index)

Sets a selected index for the picklist options. The option is ignored if the field is not a picklist or if the value is out of bounds.

Parameters
index the current index of the picklist to set.

public void setValue (Serializable value)

Sets the value for this field. Note if this field is isReadOnly() then this will not change the current value.

Parameters
value the value set for the field.

public void unsetSelectedPickListIndex ()

Resets the current picklist selection value.