Database.DMLOptions is only available for Apex saved against API versions 15.0 and higher. DMLOptions settings take effect only for record operations performed using Apex DML and not through the Salesforce user interface. The DMLOptions class has three child options.
The following are properties for DmlOptions.
public Boolean allowFieldTruncation {get; set;}
Type: Boolean
In Apex saved against API versions previous to 15.0, if you specify a value for a string and that value is too large, the value is truncated. For API version 15.0 and later, if a value is specified that is too large, the operation fails and an error message is returned. The allowFieldTruncation property allows you to specify that the previous behavior, truncation, be used instead of the new behavior in Apex saved against API versions 15.0 and later.
public Database.DmlOptions.Assignmentruleheader assignmentRuleHeader {get; set;}
Type: Database.DMLOptions.AssignmentRuleHeader
public Database.DmlOptions.EmailHeader emailHeader {get; set;}
Type: Database.DMLOptions.EmailHeader
The Salesforce user interface allows you to specify whether or not to send an email when the following events occur.
In Apex saved against API version 15.0 or later, the Database.DMLOptions emailHeader property enables you to specify additional information regarding the email that gets sent when one of the events occurs because of the code's execution.
public Database.DmlOptions.LocaleOptions localeOptions {get; set;}
Type: Database.DMLOptions.LocaleOptions
The value must be a valid user locale (language and country), such as de_DE or en_GB. The value is a String, 2-5 characters long. The first two characters are always an ISO language code, for example 'fr' or 'en.' If the value is further qualified by a country, then the string also has an underscore (_) and another ISO country code, for example 'US' or 'UK.' For example, the string for the United States is 'en_US', and the string for French Canadian is 'fr_CA.'
For a list of the languages that Salesforce supports, see Which Languages Does Salesforce Support? in the Salesforce online help.
public Boolean optAllOrNone {get; set;}
Type: Boolean
If optAllOrNone is set to true, all changes are rolled back if any record causes errors. The default for this property is false and successfully processed records are committed while records with errors aren't.
This property is available in Apex saved against Salesforce API version 20.0 and later.