0

I have created a managed package which contains a Lightning Component which uses a Custom hierarchy Settings object.

You can see here that the Settings object is packaged. enter image description here

It is referenced within the lightning component like

<aura:attribute name="settings" type="TestSettings__c"/>

within the org, the component works without a hitch. But when I attempt to deploy this package in a sandbox org, I get an error which looks like this. (The namespace has been altered) enter image description here

I am not quite sure why I am seeing this error.. and I can't find any posts of anyone else experiencing this problem.

6
  • Have you tried adding the namespace prefix MyNamspace__ to the attribute in the package dev org:<aura:attribute name="settings" type="MyNamspace__TestSettings__c"/>
    – Praveen
    Commented Jul 28, 2016 at 18:12
  • @Praveen : same result
    – Jason Lee
    Commented Jul 28, 2016 at 18:13
  • Can confirm the visibility of the custom setting? Is it marked Public/Protected?
    – Praveen
    Commented Jul 28, 2016 at 18:20
  • @Praveen : protected.
    – Jason Lee
    Commented Jul 28, 2016 at 18:21
  • Can you try changing to Public and test it?
    – Praveen
    Commented Jul 28, 2016 at 18:22

2 Answers 2

3

I thinks the issue it due to the visibility of the custom setting in the subscriber org.

Try changing the Visibility of the custom setting to Public, it would solve the issue.

1

Looking back on this question, it actually was ridiculous that the only way to make this work was to NOT use protected settings (why would that feature exist if it wasn't supposed to be used?).

After weeks of diagnosis by the Salesforce support team, we found out there is a bug with custom metadata types (including custom settings), not able to be referenced by lightning components directly, you would need to use a wrapper class to access it or else it would throw an exception.

https://success.salesforce.com/issues_view?id=a1p3A000000eqGkQAI

You must log in to answer this question.

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