Tuesday 12 March 2013


Primitive Types
 DescriptionExample
BlobBinary data stored as a single object.
Blob myBlob = Blob.valueof('idea');
BooleanValue that can only be assigned true, false, or null
Boolean isWinner = true;
DateParticular day
Date myDate = date.today();
Date weekStart = myDate.toStartofWeek();
DatetimeParticular day and time
Datetime myDateTime = datetime.now();
datetime newd = myDateTime.addMonths(2);
DecimalNumber that includes a decimal point. Decimal is an arbitrary precision number.
Decimal myDecimal = 12.4567;
Decimal divDec = myDecimal.divide
  (7, 2, System.RoundingMode.UP);
system.assertEquals(divDec, 1.78);
Double64-bit number that includes a decimal point. Minimum value -263. Maximum value of 263-1
Double d=3.14159;
ID18-character Force.com record identifier
ID id='00300000003T2PGAA0';
Integer32-bit number that does not include a decimal point. Minimum value -2,147,483,648 -- maximum value of 2,147,483,647
Integer i = 1;
Long64-bit number that does not include a decimal point. Minimum value of -263 -- maximum value of 263-1.
Long l = 2147483648L;
StringSet of characters surrounded by single quotes
String s = 'repeating memes';
TimeParticular time
Time myTime = Time.newInstance(18, 30, 2, 20);
Integer myMinutes = myTime.minute();

Categories: ,

0 comments:

Post a Comment

    Links