We are recently facing some issue related to custom label when we are creating managed package and installing in another org the custom label value is not populating . Below is the code sample : This below code is working in scratch org . where we do our usual development .
const frequencyObjectArray = [];
for (let i = 0; i < frequency.length; i++) {
component.set("v.displayMessageFrequency", $A.getReference(`$Label.c.${frequency[i].label}`));
const frequencyObject = {
label: component.get("v.displayMessageFrequency"),
value: frequency[i].frequencyValue
};
frequencyObjectArray.push(frequencyObject);
}
return frequencyObjectArray;
If we change this .c
$Label.c.${paymentfrequency[i].label
with “Namesapce” in manage package like : $A.getReference($Label. Namespace.${paymentfrequency[i].label}))
; It is working in installed org. And if we keep $A.getReference($Label. Namespace.${paymentfrequency[i].label}))
in scratch org it is not working. Hence if we have to maintain this type of conversion it will be overhead for further development. How can we solve this issue?