Protected custom settings as a parameter in an @AuraEnabled method causes errorProtected Custom Settings in managed package are not visible by apex classUsing site.getName() with custom settings method getInstance()Data in custom protected settings and its visibilityIs encrypting passwords in protected custom settings a security requirement?Custom settings field errorCustom Settings - Visibility Protected - Managed PackageCan protected custom settings be edited by the API?Parameter In AuraEnabled Method Is NullEditing protected custom settings in subscriber orgCan protected custom settings records be retrieved via SOQL Query?
Why does capacitance not depend on the material of the plates?
Pronouns when writing from the point of view of a robot
Variable doesn't parse as string
Can I enter a rental property without giving notice if I'm afraid a tenant may be hurt?
Are the related objects in an SOQL query shared?
Probably terminated or laid off soon; confront or not?
Why are there yellow dot stickers on the front doors of businesses in Russia?
Write The Shortest Program to Calculate Height of a Binary Tree
Why do proponents of guns oppose gun competency tests?
What's "halachic" about "Esav hates Ya'akov"?
Broken bottom bracket?
“The Fourier transform cannot measure two phases at the same frequency.” Why not?
Why did the US Airways Flight 1549 passengers stay on the wings?
When using the Proficiency Dice optional rule, how should they be used in determining a character's Spell Save DC?
Properties: Left of the colon
Vectorised way to calculate mean of left and right neighbours in a vector
Write The Shortest Program To Check If A Binary Tree Is Balanced
What printing process is this?
Plotting Autoregressive Functions / Linear Difference Equations
Can I use my US callsign to transmit while in El Salvador?
Is there a way to improve my grade after graduation?
I was contacted by a private bank overseas to get my inheritance
What could prevent players from leaving an island?
How do the surviving Asgardians get to Earth?
Protected custom settings as a parameter in an @AuraEnabled method causes error
Protected Custom Settings in managed package are not visible by apex classUsing site.getName() with custom settings method getInstance()Data in custom protected settings and its visibilityIs encrypting passwords in protected custom settings a security requirement?Custom settings field errorCustom Settings - Visibility Protected - Managed PackageCan protected custom settings be edited by the API?Parameter In AuraEnabled Method Is NullEditing protected custom settings in subscriber orgCan protected custom settings records be retrieved via SOQL Query?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Given
Apex controller
@AuraEnabled
public static String saveAppSetting(AppSetting__c config)
if (config == null)
throw new AuraHandledException(System.Label.NO_DATA);
// skipped for brevity
return 'success';
Aura component helper
saveAppSetting: function(component)
const action = component.get("c.saveAppSetting");
action.setParam("config", null);
action.setCallback(this, function(response)
const state = response.getState();
if (state === "SUCCESS")
console.log("Success");
else
console.error("Error");
);
$A.enqueueAction(action);
When I execute this in a scratch org with a namespace, everything is fine. When this code runs in a subscriber org inside an installed managed packed, this ends up with the following error:
It doesn't get to this if (config == null)
line on server, so it must break during deserialization and this is out of developer reach. Has anyone had such issues and does anybody know how to address it?
apex managed-package
add a comment |
Given
Apex controller
@AuraEnabled
public static String saveAppSetting(AppSetting__c config)
if (config == null)
throw new AuraHandledException(System.Label.NO_DATA);
// skipped for brevity
return 'success';
Aura component helper
saveAppSetting: function(component)
const action = component.get("c.saveAppSetting");
action.setParam("config", null);
action.setCallback(this, function(response)
const state = response.getState();
if (state === "SUCCESS")
console.log("Success");
else
console.error("Error");
);
$A.enqueueAction(action);
When I execute this in a scratch org with a namespace, everything is fine. When this code runs in a subscriber org inside an installed managed packed, this ends up with the following error:
It doesn't get to this if (config == null)
line on server, so it must break during deserialization and this is out of developer reach. Has anyone had such issues and does anybody know how to address it?
apex managed-package
add a comment |
Given
Apex controller
@AuraEnabled
public static String saveAppSetting(AppSetting__c config)
if (config == null)
throw new AuraHandledException(System.Label.NO_DATA);
// skipped for brevity
return 'success';
Aura component helper
saveAppSetting: function(component)
const action = component.get("c.saveAppSetting");
action.setParam("config", null);
action.setCallback(this, function(response)
const state = response.getState();
if (state === "SUCCESS")
console.log("Success");
else
console.error("Error");
);
$A.enqueueAction(action);
When I execute this in a scratch org with a namespace, everything is fine. When this code runs in a subscriber org inside an installed managed packed, this ends up with the following error:
It doesn't get to this if (config == null)
line on server, so it must break during deserialization and this is out of developer reach. Has anyone had such issues and does anybody know how to address it?
apex managed-package
Given
Apex controller
@AuraEnabled
public static String saveAppSetting(AppSetting__c config)
if (config == null)
throw new AuraHandledException(System.Label.NO_DATA);
// skipped for brevity
return 'success';
Aura component helper
saveAppSetting: function(component)
const action = component.get("c.saveAppSetting");
action.setParam("config", null);
action.setCallback(this, function(response)
const state = response.getState();
if (state === "SUCCESS")
console.log("Success");
else
console.error("Error");
);
$A.enqueueAction(action);
When I execute this in a scratch org with a namespace, everything is fine. When this code runs in a subscriber org inside an installed managed packed, this ends up with the following error:
It doesn't get to this if (config == null)
line on server, so it must break during deserialization and this is out of developer reach. Has anyone had such issues and does anybody know how to address it?
apex managed-package
apex managed-package
asked Jul 25 at 14:15
EduardEduard
2,2632 gold badges8 silver badges29 bronze badges
2,2632 gold badges8 silver badges29 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
The standard workaround for this is to use a normal String parameter instead:
@AuraEnabled
public static String saveAppSetting(String configJson)
AppSetting__c config = (AppSetting__c)
JSON.deserialize(configJson, AppSetting__c.class);
action.setParam("configJson", JSON.stringify(null)); // Or an Object
In the meantime, you might want to report the bug to Support. As far as I can tell, this should work, it's just a glitch in the platform.
add a comment |
I think issue might be with namespace of object.
@AuraEnabled
public static String saveAppSetting(namespace__AppSetting__c config)
Try by adding namespace in auraenabled parameters. I think fields are passed with namespace but if not Pass fields also with namespace from lightning component.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "459"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f271009%2fprotected-custom-settings-as-a-parameter-in-an-auraenabled-method-causes-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The standard workaround for this is to use a normal String parameter instead:
@AuraEnabled
public static String saveAppSetting(String configJson)
AppSetting__c config = (AppSetting__c)
JSON.deserialize(configJson, AppSetting__c.class);
action.setParam("configJson", JSON.stringify(null)); // Or an Object
In the meantime, you might want to report the bug to Support. As far as I can tell, this should work, it's just a glitch in the platform.
add a comment |
The standard workaround for this is to use a normal String parameter instead:
@AuraEnabled
public static String saveAppSetting(String configJson)
AppSetting__c config = (AppSetting__c)
JSON.deserialize(configJson, AppSetting__c.class);
action.setParam("configJson", JSON.stringify(null)); // Or an Object
In the meantime, you might want to report the bug to Support. As far as I can tell, this should work, it's just a glitch in the platform.
add a comment |
The standard workaround for this is to use a normal String parameter instead:
@AuraEnabled
public static String saveAppSetting(String configJson)
AppSetting__c config = (AppSetting__c)
JSON.deserialize(configJson, AppSetting__c.class);
action.setParam("configJson", JSON.stringify(null)); // Or an Object
In the meantime, you might want to report the bug to Support. As far as I can tell, this should work, it's just a glitch in the platform.
The standard workaround for this is to use a normal String parameter instead:
@AuraEnabled
public static String saveAppSetting(String configJson)
AppSetting__c config = (AppSetting__c)
JSON.deserialize(configJson, AppSetting__c.class);
action.setParam("configJson", JSON.stringify(null)); // Or an Object
In the meantime, you might want to report the bug to Support. As far as I can tell, this should work, it's just a glitch in the platform.
answered Jul 25 at 14:39
sfdcfoxsfdcfox
281k14 gold badges227 silver badges481 bronze badges
281k14 gold badges227 silver badges481 bronze badges
add a comment |
add a comment |
I think issue might be with namespace of object.
@AuraEnabled
public static String saveAppSetting(namespace__AppSetting__c config)
Try by adding namespace in auraenabled parameters. I think fields are passed with namespace but if not Pass fields also with namespace from lightning component.
add a comment |
I think issue might be with namespace of object.
@AuraEnabled
public static String saveAppSetting(namespace__AppSetting__c config)
Try by adding namespace in auraenabled parameters. I think fields are passed with namespace but if not Pass fields also with namespace from lightning component.
add a comment |
I think issue might be with namespace of object.
@AuraEnabled
public static String saveAppSetting(namespace__AppSetting__c config)
Try by adding namespace in auraenabled parameters. I think fields are passed with namespace but if not Pass fields also with namespace from lightning component.
I think issue might be with namespace of object.
@AuraEnabled
public static String saveAppSetting(namespace__AppSetting__c config)
Try by adding namespace in auraenabled parameters. I think fields are passed with namespace but if not Pass fields also with namespace from lightning component.
answered Jul 25 at 15:38
Manjot SinghManjot Singh
2,4217 silver badges24 bronze badges
2,4217 silver badges24 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Salesforce Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f271009%2fprotected-custom-settings-as-a-parameter-in-an-auraenabled-method-causes-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown