• Ralfo A. Nunes
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
When trying to set a value in picklist field using APEX for a custom object, we need to guarantee the same value disregarding the user current language when the record is saved.

Current code:
Custom_Object__c ojb = new Custom_Object__c();
ojb.Status__c = 'Liberado';

Org is working with 2 languages (Portuguese and English), where picklists are translated. Portuguese is default.

Issue: If we run as a user in English, the record is saved with the value 'Released' instead of 'Liberado'. That is, the value saved in the record is different depending on the user language, what is a big issue for the system logic.

Question: is this the standard behavior? How can we guarantee the same value using the APEX?
When trying to set a value in picklist field using APEX for a custom object, we need to guarantee the same value disregarding the user current language when the record is saved.

Current code:
Custom_Object__c ojb = new Custom_Object__c();
ojb.Status__c = 'Liberado';

Org is working with 2 languages (Portuguese and English), where picklists are translated. Portuguese is default.

Issue: If we run as a user in English, the record is saved with the value 'Released' instead of 'Liberado'. That is, the value saved in the record is different depending on the user language, what is a big issue for the system logic.

Question: is this the standard behavior? How can we guarantee the same value using the APEX?