1

We have two Orgs, DEV and SIT (SIT installed by managed package ), and both have namespaces.

In SIT the dynamic reference to the custom labels do not work, but in the Dev org they work.

Below is the code with the issue:

var labelReference = $A.getReference('$Label.c.' + RVT_MAX_NUMBER_DAYS_IN_PERIOD_LABEL);
component.set("v.tempLabelAttr", labelReference);
var dynamicLabel = component.get("v.tempLabelAttr");

In the DEV Org we get the custom label value but in SIT we get a empty string.

In the browser console in SIT i tried to access the custom label with the following code:

$A.get('$Label.NAME_SPACE.RVT_MAX_NUMBER_DAYS_IN_PERIOD_LABEL')

it works and I get the value that I expected from the initial code, but be same snip o code in the DEV org will return an empty string.

It seems that in one place I need the name space to access the custom label and in the other I don´t!

What am I missing here in this inconsistency and how to get around it?

1 Answer 1

0

You need to know the namespace. This is one of the major problems with working without Scratch Orgs. In a Scratch Org, you can specify the namespace so you have a consistent experience while developing your package. You might want to consider not using Developer Edition orgs for development while working in Lightning.

1
  • Hi @sfdcfox thanks for the input. Unfortunately Scratch Orgs are not an option, decisions above me.
    – Sam.A
    Commented Jul 9, 2018 at 17:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .