pp108 : getFormatType()

getFormatType()


It returns the current format type that is attached to the control.

If a data type is specified, it returns a new format type for the specified data type with the formatting attributes copied from the current format.

Syntax

Script

Control.getFormatType([sDataType])


You can specify the following data types as a parameter:

  • integer
  • float
  • double
  • decimal
  • amount
  • date
  • dateTime
  • text
  • string
  • base64binary
  • hexbinary
  • anyuri

    The parameter must be passed as a string.

Parameters

Parameter

Description

sDataType

Optional, String. Denotes the data type for which the format type needs to be created.


Return Value


It returns the format type.

Example

function getReceivedDateFormat()
{
// get the format type for receivedDate field
    var receivedDateFormat = receivedDate.getFormatType();
//get the display format
    var displayFormat = receivedDateFormat.getDisplayFormat();
    application.notify(displayFormat);
    return displayFormat;
}

Applies to


Input, List, Output, Select, Textarea

Related reference

Format Type
setFormatType()
format()