I have two helper functions that are the exact same, one executes and one doesn't. How come?How to develop for an organization that has a custom field that my organisation doesn't have?Aura StaticResource Javascript helper classesAccessing data in the controller and app file that is returned from a helper functionsave two records in two objects with a single save button with lightning componentsAre Address fields are restricted to save in LDS?I have a form in lightning where the fields are retrieved from the fieldsets, now i need to have edit and save options in that
In chocolate terminology, what is the name of thinly sliced leaf-shaped toppings made from hot, smooth chocolate, used to form flower petals?
Can there be plants on the dark side of a tidally locked world?
Why does this syntax outputs an error under METAFUN/METAPOST?
Why is k-means used for non normally distributed data?
Are there photos of the Apollo LM showing disturbed lunar soil resulting from descent engine exhaust?
How to run a command 1 out of N times in Bash
Can an intercepting fighter jet force a small propeller aircraft down without completely destroying it?
Is it rude to ask my opponent to resign an online game when they have a lost endgame?
How to add some symbol (or just add newline) if the numbers in the text are not continuous
How to disambiguate between various meditation practices?
Remove ads in Viber for PC
What exactly is a softlock?
How could reincarnation magic be limited to prevent overuse?
What is the maximal acceptable delay between pilot's input and flight control surface actuation?
Initializing a std::array with a constant value
Can a Beholder face its Antimagic Cone behind itself?
Would there be balance issues if I allowed opportunity attacks against any creature, not just hostile ones?
Why not use futuristic pavise ballistic shields for protection?
Some questions about Lightning and Tor
Why do old games use flashing as means of showing damage?
Using font to highlight a god's speech in dialogue
Solve this icositetragram
Advisor suggesting a change in the PhD research direction resulting in less theoretically intensive thesis. I am worrying about the implications
How is total raw calculated for Science Pack 2?
I have two helper functions that are the exact same, one executes and one doesn't. How come?
How to develop for an organization that has a custom field that my organisation doesn't have?Aura StaticResource Javascript helper classesAccessing data in the controller and app file that is returned from a helper functionsave two records in two objects with a single save button with lightning componentsAre Address fields are restricted to save in LDS?I have a form in lightning where the fields are retrieved from the fieldsets, now i need to have edit and save options in that
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
So I have many of these, 10 to be exact and three won't execute, they are all the exact same and I feel I have been going around in circles for hours. I have noticed that if an apex method ends with the letter "s" that it won't execute the callback for some reason. Don't know if this is something everyone experiences or just me. But I have tried renaming the apex methods, the variables, everything i can think of. Below i can get through propTen
just fine and it does what its suppose to do, but it will only get to alert 4
of propTwentyFive. And i can't figure out why it wont execute the callback.
Any thoughts?
grayButtons: function(component, event, helper)
helper.PropTen(component, event);
helper.PropTwentyFive(component,event);
,
PropTen: function(component, event)
var action = component.get("c.PropTenPercent");
var myId = component.find("accordion").get("v.activeSectionName");
action.setParams("ten" : myId);
action.setCallback(this, function(response)
var state = response.getState();
if(state === "SUCCESS")
var storeResponse = response.getReturnValue();
if (response.getReturnValue().length != 0)
component.set("v.isDisabled11", "false");
else
component.set("v.isDisabled11", "true");
else
alert("Unknown error");
);
$A.enqueueAction(action);
,
PropTwentyFive: function(component, event)
alert('1');
var action = component.get("c.PropTwentyFive");
alert('2');
var myId = component.find("accordion").get("v.activeSectionName");
alert(myId);
action.setParams("twentyFive" : myId);
alert('4');
action.setCallback(this, function(response)
alert('5');
var state = response.getState();
if(state === "SUCCESS")
var storeResponse = response.getReturnValue();
if (response.getReturnValue().length != 0)
component.set("v.isDisabled12", "false");
else
component.set("v.isDisabled12", "true");
else
alert("Unknown error");
);
$A.enqueueAction(action);
,
@AuraEnabled
public static List <Opportunity> PropTenPercent(String ten)
List <opportunity> hipdeals = new List<opportunity>();
String otherattr = ten;
hipdeals = [[select Ownership__c,Name,NextStep
from opportunity where recordtype.name in ('Test') and Name =: otherattr and Probability = 10];
return hipdeals;
//25% deals
@AuraEnabled
public static List <Opportunity> PropTwentyFive(String twentyFive)
List <opportunity> hipdeals = new List<opportunity>();
String otherattr = twentyFive;
hipdeals = [select Ownership__c,Name,NextStep
from opportunity where recordtype.name in ('Test') and Name =: otherattr and Probability = 25];
return hipdeals;
apex lightning-aura-components callback
add a comment |
So I have many of these, 10 to be exact and three won't execute, they are all the exact same and I feel I have been going around in circles for hours. I have noticed that if an apex method ends with the letter "s" that it won't execute the callback for some reason. Don't know if this is something everyone experiences or just me. But I have tried renaming the apex methods, the variables, everything i can think of. Below i can get through propTen
just fine and it does what its suppose to do, but it will only get to alert 4
of propTwentyFive. And i can't figure out why it wont execute the callback.
Any thoughts?
grayButtons: function(component, event, helper)
helper.PropTen(component, event);
helper.PropTwentyFive(component,event);
,
PropTen: function(component, event)
var action = component.get("c.PropTenPercent");
var myId = component.find("accordion").get("v.activeSectionName");
action.setParams("ten" : myId);
action.setCallback(this, function(response)
var state = response.getState();
if(state === "SUCCESS")
var storeResponse = response.getReturnValue();
if (response.getReturnValue().length != 0)
component.set("v.isDisabled11", "false");
else
component.set("v.isDisabled11", "true");
else
alert("Unknown error");
);
$A.enqueueAction(action);
,
PropTwentyFive: function(component, event)
alert('1');
var action = component.get("c.PropTwentyFive");
alert('2');
var myId = component.find("accordion").get("v.activeSectionName");
alert(myId);
action.setParams("twentyFive" : myId);
alert('4');
action.setCallback(this, function(response)
alert('5');
var state = response.getState();
if(state === "SUCCESS")
var storeResponse = response.getReturnValue();
if (response.getReturnValue().length != 0)
component.set("v.isDisabled12", "false");
else
component.set("v.isDisabled12", "true");
else
alert("Unknown error");
);
$A.enqueueAction(action);
,
@AuraEnabled
public static List <Opportunity> PropTenPercent(String ten)
List <opportunity> hipdeals = new List<opportunity>();
String otherattr = ten;
hipdeals = [[select Ownership__c,Name,NextStep
from opportunity where recordtype.name in ('Test') and Name =: otherattr and Probability = 10];
return hipdeals;
//25% deals
@AuraEnabled
public static List <Opportunity> PropTwentyFive(String twentyFive)
List <opportunity> hipdeals = new List<opportunity>();
String otherattr = twentyFive;
hipdeals = [select Ownership__c,Name,NextStep
from opportunity where recordtype.name in ('Test') and Name =: otherattr and Probability = 25];
return hipdeals;
apex lightning-aura-components callback
add a comment |
So I have many of these, 10 to be exact and three won't execute, they are all the exact same and I feel I have been going around in circles for hours. I have noticed that if an apex method ends with the letter "s" that it won't execute the callback for some reason. Don't know if this is something everyone experiences or just me. But I have tried renaming the apex methods, the variables, everything i can think of. Below i can get through propTen
just fine and it does what its suppose to do, but it will only get to alert 4
of propTwentyFive. And i can't figure out why it wont execute the callback.
Any thoughts?
grayButtons: function(component, event, helper)
helper.PropTen(component, event);
helper.PropTwentyFive(component,event);
,
PropTen: function(component, event)
var action = component.get("c.PropTenPercent");
var myId = component.find("accordion").get("v.activeSectionName");
action.setParams("ten" : myId);
action.setCallback(this, function(response)
var state = response.getState();
if(state === "SUCCESS")
var storeResponse = response.getReturnValue();
if (response.getReturnValue().length != 0)
component.set("v.isDisabled11", "false");
else
component.set("v.isDisabled11", "true");
else
alert("Unknown error");
);
$A.enqueueAction(action);
,
PropTwentyFive: function(component, event)
alert('1');
var action = component.get("c.PropTwentyFive");
alert('2');
var myId = component.find("accordion").get("v.activeSectionName");
alert(myId);
action.setParams("twentyFive" : myId);
alert('4');
action.setCallback(this, function(response)
alert('5');
var state = response.getState();
if(state === "SUCCESS")
var storeResponse = response.getReturnValue();
if (response.getReturnValue().length != 0)
component.set("v.isDisabled12", "false");
else
component.set("v.isDisabled12", "true");
else
alert("Unknown error");
);
$A.enqueueAction(action);
,
@AuraEnabled
public static List <Opportunity> PropTenPercent(String ten)
List <opportunity> hipdeals = new List<opportunity>();
String otherattr = ten;
hipdeals = [[select Ownership__c,Name,NextStep
from opportunity where recordtype.name in ('Test') and Name =: otherattr and Probability = 10];
return hipdeals;
//25% deals
@AuraEnabled
public static List <Opportunity> PropTwentyFive(String twentyFive)
List <opportunity> hipdeals = new List<opportunity>();
String otherattr = twentyFive;
hipdeals = [select Ownership__c,Name,NextStep
from opportunity where recordtype.name in ('Test') and Name =: otherattr and Probability = 25];
return hipdeals;
apex lightning-aura-components callback
So I have many of these, 10 to be exact and three won't execute, they are all the exact same and I feel I have been going around in circles for hours. I have noticed that if an apex method ends with the letter "s" that it won't execute the callback for some reason. Don't know if this is something everyone experiences or just me. But I have tried renaming the apex methods, the variables, everything i can think of. Below i can get through propTen
just fine and it does what its suppose to do, but it will only get to alert 4
of propTwentyFive. And i can't figure out why it wont execute the callback.
Any thoughts?
grayButtons: function(component, event, helper)
helper.PropTen(component, event);
helper.PropTwentyFive(component,event);
,
PropTen: function(component, event)
var action = component.get("c.PropTenPercent");
var myId = component.find("accordion").get("v.activeSectionName");
action.setParams("ten" : myId);
action.setCallback(this, function(response)
var state = response.getState();
if(state === "SUCCESS")
var storeResponse = response.getReturnValue();
if (response.getReturnValue().length != 0)
component.set("v.isDisabled11", "false");
else
component.set("v.isDisabled11", "true");
else
alert("Unknown error");
);
$A.enqueueAction(action);
,
PropTwentyFive: function(component, event)
alert('1');
var action = component.get("c.PropTwentyFive");
alert('2');
var myId = component.find("accordion").get("v.activeSectionName");
alert(myId);
action.setParams("twentyFive" : myId);
alert('4');
action.setCallback(this, function(response)
alert('5');
var state = response.getState();
if(state === "SUCCESS")
var storeResponse = response.getReturnValue();
if (response.getReturnValue().length != 0)
component.set("v.isDisabled12", "false");
else
component.set("v.isDisabled12", "true");
else
alert("Unknown error");
);
$A.enqueueAction(action);
,
@AuraEnabled
public static List <Opportunity> PropTenPercent(String ten)
List <opportunity> hipdeals = new List<opportunity>();
String otherattr = ten;
hipdeals = [[select Ownership__c,Name,NextStep
from opportunity where recordtype.name in ('Test') and Name =: otherattr and Probability = 10];
return hipdeals;
//25% deals
@AuraEnabled
public static List <Opportunity> PropTwentyFive(String twentyFive)
List <opportunity> hipdeals = new List<opportunity>();
String otherattr = twentyFive;
hipdeals = [select Ownership__c,Name,NextStep
from opportunity where recordtype.name in ('Test') and Name =: otherattr and Probability = 25];
return hipdeals;
apex lightning-aura-components callback
apex lightning-aura-components callback
edited 9 hours ago
Tyler
asked 10 hours ago
TylerTyler
398 bronze badges
398 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
From this documentation,
Use unique names for client-side and server-side actions in a
component. A JavaScript function (client-side action) with the same
name as an Apex method (server-side action ) can lead to hard-to-debug
issues. In debug mode, the framework logs a browser console warning
about the clashing client-side and server-side action names.
Reason:
Lightning is MVC model framework. In view (HTML/COMPONENT) you can get the value
of an attribute by using v.
and you can get the reference of javascript method by using c.
and again in javascript, you need to get the reference to apex method definition by using same c.
. Here is what is interesting, aura_prod
library internally gets confused when both javascript method (controller/helper) and apex method names are same as they both are referenced by c.
!!
Here is another documentation where its clear that salesforce agrees that they made mistake while writing the framework:
“Wait a minute. Are you telling me we have c the client-side
controller, c the default namespace, and c the server-side controller,
all in Aura components?”
Well, in a word, yes. Deep breaths.
Look, we’ll be honest with you. If we had it all to do over again, we
might have made some different choices. While the choices we made
weren’t accidents, three “c”s is definitely an opportunity for
confusion. We get confused too!
But as they say, it is what it is. Forewarned is forearmed. Now you
know.
add a comment |
Update: The solution was changing PropTwentyFive
to PropTwentyFivePercent
or simply Property
. I'm not entirely sure on naming conventions but it appears that you can't name an apex method the same name as the helper that is calling it.
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%2f275694%2fi-have-two-helper-functions-that-are-the-exact-same-one-executes-and-one-doesn%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
From this documentation,
Use unique names for client-side and server-side actions in a
component. A JavaScript function (client-side action) with the same
name as an Apex method (server-side action ) can lead to hard-to-debug
issues. In debug mode, the framework logs a browser console warning
about the clashing client-side and server-side action names.
Reason:
Lightning is MVC model framework. In view (HTML/COMPONENT) you can get the value
of an attribute by using v.
and you can get the reference of javascript method by using c.
and again in javascript, you need to get the reference to apex method definition by using same c.
. Here is what is interesting, aura_prod
library internally gets confused when both javascript method (controller/helper) and apex method names are same as they both are referenced by c.
!!
Here is another documentation where its clear that salesforce agrees that they made mistake while writing the framework:
“Wait a minute. Are you telling me we have c the client-side
controller, c the default namespace, and c the server-side controller,
all in Aura components?”
Well, in a word, yes. Deep breaths.
Look, we’ll be honest with you. If we had it all to do over again, we
might have made some different choices. While the choices we made
weren’t accidents, three “c”s is definitely an opportunity for
confusion. We get confused too!
But as they say, it is what it is. Forewarned is forearmed. Now you
know.
add a comment |
From this documentation,
Use unique names for client-side and server-side actions in a
component. A JavaScript function (client-side action) with the same
name as an Apex method (server-side action ) can lead to hard-to-debug
issues. In debug mode, the framework logs a browser console warning
about the clashing client-side and server-side action names.
Reason:
Lightning is MVC model framework. In view (HTML/COMPONENT) you can get the value
of an attribute by using v.
and you can get the reference of javascript method by using c.
and again in javascript, you need to get the reference to apex method definition by using same c.
. Here is what is interesting, aura_prod
library internally gets confused when both javascript method (controller/helper) and apex method names are same as they both are referenced by c.
!!
Here is another documentation where its clear that salesforce agrees that they made mistake while writing the framework:
“Wait a minute. Are you telling me we have c the client-side
controller, c the default namespace, and c the server-side controller,
all in Aura components?”
Well, in a word, yes. Deep breaths.
Look, we’ll be honest with you. If we had it all to do over again, we
might have made some different choices. While the choices we made
weren’t accidents, three “c”s is definitely an opportunity for
confusion. We get confused too!
But as they say, it is what it is. Forewarned is forearmed. Now you
know.
add a comment |
From this documentation,
Use unique names for client-side and server-side actions in a
component. A JavaScript function (client-side action) with the same
name as an Apex method (server-side action ) can lead to hard-to-debug
issues. In debug mode, the framework logs a browser console warning
about the clashing client-side and server-side action names.
Reason:
Lightning is MVC model framework. In view (HTML/COMPONENT) you can get the value
of an attribute by using v.
and you can get the reference of javascript method by using c.
and again in javascript, you need to get the reference to apex method definition by using same c.
. Here is what is interesting, aura_prod
library internally gets confused when both javascript method (controller/helper) and apex method names are same as they both are referenced by c.
!!
Here is another documentation where its clear that salesforce agrees that they made mistake while writing the framework:
“Wait a minute. Are you telling me we have c the client-side
controller, c the default namespace, and c the server-side controller,
all in Aura components?”
Well, in a word, yes. Deep breaths.
Look, we’ll be honest with you. If we had it all to do over again, we
might have made some different choices. While the choices we made
weren’t accidents, three “c”s is definitely an opportunity for
confusion. We get confused too!
But as they say, it is what it is. Forewarned is forearmed. Now you
know.
From this documentation,
Use unique names for client-side and server-side actions in a
component. A JavaScript function (client-side action) with the same
name as an Apex method (server-side action ) can lead to hard-to-debug
issues. In debug mode, the framework logs a browser console warning
about the clashing client-side and server-side action names.
Reason:
Lightning is MVC model framework. In view (HTML/COMPONENT) you can get the value
of an attribute by using v.
and you can get the reference of javascript method by using c.
and again in javascript, you need to get the reference to apex method definition by using same c.
. Here is what is interesting, aura_prod
library internally gets confused when both javascript method (controller/helper) and apex method names are same as they both are referenced by c.
!!
Here is another documentation where its clear that salesforce agrees that they made mistake while writing the framework:
“Wait a minute. Are you telling me we have c the client-side
controller, c the default namespace, and c the server-side controller,
all in Aura components?”
Well, in a word, yes. Deep breaths.
Look, we’ll be honest with you. If we had it all to do over again, we
might have made some different choices. While the choices we made
weren’t accidents, three “c”s is definitely an opportunity for
confusion. We get confused too!
But as they say, it is what it is. Forewarned is forearmed. Now you
know.
answered 7 hours ago
salesforce-sassalesforce-sas
8,3161 gold badge3 silver badges25 bronze badges
8,3161 gold badge3 silver badges25 bronze badges
add a comment |
add a comment |
Update: The solution was changing PropTwentyFive
to PropTwentyFivePercent
or simply Property
. I'm not entirely sure on naming conventions but it appears that you can't name an apex method the same name as the helper that is calling it.
add a comment |
Update: The solution was changing PropTwentyFive
to PropTwentyFivePercent
or simply Property
. I'm not entirely sure on naming conventions but it appears that you can't name an apex method the same name as the helper that is calling it.
add a comment |
Update: The solution was changing PropTwentyFive
to PropTwentyFivePercent
or simply Property
. I'm not entirely sure on naming conventions but it appears that you can't name an apex method the same name as the helper that is calling it.
Update: The solution was changing PropTwentyFive
to PropTwentyFivePercent
or simply Property
. I'm not entirely sure on naming conventions but it appears that you can't name an apex method the same name as the helper that is calling it.
answered 9 hours ago
TylerTyler
398 bronze badges
398 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%2f275694%2fi-have-two-helper-functions-that-are-the-exact-same-one-executes-and-one-doesn%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