You need to sign in to do that
Don't have an account?
Fabio Scheurel
How to retrieve a profile in an APEX unittest in a non-localized way?
Every unit test example for APEX code retrieves the Profile using the following SOQL:
How can I retrieve a profile from the database without being dependant of the user's language? Is there a default System.Label for standard profile names?
SELECT Id FROM Profile WHERE Name = 'System Administrator'When I am deploying my unit tests to another Org, which has set another language (e.g. German), this SOQL won't work. The Profile.Name is always returned localized, in German it says "Systemadministrator".
How can I retrieve a profile from the database without being dependant of the user's language? Is there a default System.Label for standard profile names?
You can call custom label in apex as Label.CustomLabelName ;
Use toLabel()
This query returns lead records with the record type name translated into the language for the user who issued the query.
You can use toLabel() to filter records using a translated picklist value. For example:
Lead records are returned where the picklist value for Status is 'le Draft.' The comparison is made against the value for the user’s language. If no translation is available for the user’s language for the specified picklist, the comparison is made against the master values.
Regards
You can Create System label in the org.
1) Steps are here Click on your name at righ top corner--> Click On setup--> at Right hand side there is a section App Setup --> Create --> Custom label.
2) Create a new label and access that custom label in you code.
3) Custom label are converted in org language.
If this post helps you than mark it as solution, Enjoy APEX
You can always use Like 'System%'
https://help.salesforce.com/HTViewHelpDoc?id=cl_about.htm&language=en_US
May be this helps you.
This condition is true for System admins only.