Skip to main content

How can I edit a Custom Label in Production Org where the custom label is protected and belongs to a managed Package. The documentation on Custom Label says that it is not subscriber editable if it is marked as Protected.

 

#User Interface  #Custom Labels

1 resposta
  1. 5 de jul. de 2021, 17:45

    Yes, The documentation does say that managed package custom Labels are not subscriber editable, and in a way that is correct. But you can OVERRIDE the custom label with the new value in English language(*if that is your language) using Translation Workbench. There is a difference between the work edit and override. 

    For simpler understanding refer to the following link; else continue reading the comment.

     https://help.salesforce.com/articleView?id=sf.cl_translate_edit.htm&type=5

     

    Step 1 : Enable Translation Workbench for your org. 

    Go to Setup -> In Quick find type "Translation" -> Select "Translation Language Settings" -> Click "Enable" button. 

    Step 2 : Add a language (*for Example English) after enabling Translation Workbench. 

    In the same page "Translation Language Settings" click on "Add Button" -> For the first time by default English will be selected  and Active checkbox will be/needs to be marked as true; else select a new language -> In the "Identify Translators for this Language" section add yourself in the Selected List -> Click "Save". Now English language can be used to override values using Translation workbench.

    Step 3 : Override the value in the Managed package Custom Label to be referenced in Apex class and Client-side Javascript .

    Go to Setup -> In Quick find type "Custom Labels" and select "Custom Labels" -> Select the Managed package Custom Label that you need to OVERRIDE(*not edit) -> In the Translations related list, click New to enter a new translation -> Select the Language you are translating into (* right now English as you have added this one in Step 2) -> In the Translation Text field, enter the translated value. This text overrides the value specified in the label's Value field when a user's default language is the translation language for both Apex class and Client side -> Save your changes.

    (N.B.: The main purpose of custom Labels in my opinion is for UI and not Apex classes)

0/9000