Does anyone know practical application or a sample code for DMLOptions --localeoptions
Documentation says:
localeOptions Property
The localeOptions property specifies the language of any labels that are returned by Apex. 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.'
But i couldn't make it work with sample code below,I expected to see record in database in German below..May be i got the purpose of this all together wrong.please guide
Account a = new account(name=System.Label.label1);
database.dmloptions d = new database.dmloptions();
d.localeoptions ='de_DE';
database.insert(a,d);