AppExchange logo

Primitive Data Types


The API uses the following primitive data types:

Value
Description
base64Binary

Base 64-encoded binary data. Fields of this type are used for storing binary files in Attachments, Documents, and Scontrol objects. In these objects, the Body or Binary field contains the (base64 encoded) data, while the BodyLength field defines the length of the data in the Body or Binary field. In the Document object, you can specify a URL to the document instead of storing the document directly in the record.

 

boolean

Boolean fields have one of these values: True (or 1), or False (or 0).

date

Date data. Fields of this type contain date values, such as ActivityDate in the Event object. Unlike dateTime fields, date fields contain no time value-the time portion of a date field is not relevant and is always set to midnight in the GMT/UTC time zone.

dateTime
Date/time values (timestamps). Fields of this type handle date/time values (timestamps), such as ActivityDateTime in the Event object or the CreatedDate, LastModifiedDate, or SystemModstamp in many objects. Regular dateTime fields are full timestamps with a precision of one second. They are always transferred in the GMT/UTC time zone. In your client application, you might need to translate the timestamp to or from a local time zone.

Development tools differ in the way that they handle time data. Some development tools report the local time, while others report only the GMT time. To determine how your development tool handles time values, refer to its documentation.

 

Note that the Event object has a DurationInMinutes field that specifies the number of minutes for an event. Even though this is a temporal value, it is an integer type-not a dateTime type.

double
Double values. Fields of this type can contain fractional portions (digits to the right of the decimal place), such as ConversionRate in CurrencyType.
 
In the API, all non-integer values (such as Currency Field Type and Percent Field Type) contain values of type double.
 
Some restrictions may be applied to double values:
  • scale: maximum number of digits to the right of the decimal place.
  • precision: Total number of digits, including those to the left and the right of the decimal place

 

The maximum number of digits to the left of the decimal place is equal to precision minus scale. In the online application, precision is defined differently-it is the maximum number of digits allowed to the left of the decimal place.

int
Fields of this type contain numbers with no fractional portion (digits to the right of a decimal place), such as the NumberOfEmployees in an Account. For integer fields, the digits field specifies the maximum number of digits that an integer can have.
string
Character strings. Fields that are of datatype string contain text and some have length restrictions depending on the data being stored. For example, in the Contact object, the FirstName field is 40 characters, the LastName field is 80 characters, the MailingStreet is 255 characters.

These data types are used in the SOAP messages that are exchanged between your client application and the AppExchange Web service. When writing your client application, follow the data typing rules defined for your programming language and development environment. Your development tool handles the mapping of typed data in your programming language with these SOAP data types.

The primitive data types are:

Primitive types are used as a standardized way to define, send, receive, and interpret basic data types in the SOAP messages exchanged between client applications and the AppExchange Web service. In addition, primitive data types are interpreted in a Salesforce-specific way, which is useful for display formatting and for numeric conversion (adding values of different currencies).

For example, Salesforce chooses to interpret a double value passed via SOAP as a double in a number of possible ways, depending on the field definition. If the field type for that data is currency, Salesforce handles the display of the data by prepending it with a currency symbol and inserting a decimal for precision. Similarly, if the field type is percent, Salesforce handles the display of the data by appending a percent sign (%). Regardless of the field type, however, the value is sent in the SOAP message as a double.

The API also uses datatypes we have defined in the WSDLs, called field types. For more information, see Field Types, and for more information about the WSDLs, see WSDL Files for Web Services.


© Copyright 2000-2006 salesforce.com, inc.
All rights reserved • Various trademarks held by their respective owners.
Have feedback about this page? Click the red email icon in the top right corner to contact us.