{"id":110,"date":"2017-04-10T14:07:43","date_gmt":"2017-04-10T12:07:43","guid":{"rendered":"https:\/\/transferttexei.wordpress.com\/2021\/08\/10\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/"},"modified":"2023-08-16T15:14:29","modified_gmt":"2023-08-16T13:14:29","slug":"lightning-components-auraenabled-method-parameters-whats-working-and-whats-not","status":"publish","type":"post","link":"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/","title":{"rendered":"Lightning Components &#038; AuraEnabled method parameters: What\u2019s working and what\u2019s not"},"content":{"rendered":"\r\n<p><strong>Passing values from client-side to server-side is an important part of Lightning Component Development, and is pretty easy once you understood the way to write it. In\u00a0theory.<\/strong><\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Passing a value to a server-side controller<\/h2>\r\n\r\n\r\n\r\n<p>Let\u2019s take a very simple example of a server-side call in a Lightning Component. There is 3 parts in this call:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>An attribute value stored on the component markup<\/li>\r\n<li>A server-side Apex controller that will receive and use the value<\/li>\r\n<li>A client-side JavaScript controller that will make the link between them<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-full\"><\/figure>\r\n<p>&nbsp;<\/p>\r\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-5384 size-full\" src=\"https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Lightning-Web-Component-Challenge-2.png\" alt=\"Illustration of a server-side call in a Lightning Component\" width=\"2000\" height=\"1414\" srcset=\"https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Lightning-Web-Component-Challenge-2-200x141.png 200w, https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Lightning-Web-Component-Challenge-2-300x212.png 300w, https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Lightning-Web-Component-Challenge-2-400x283.png 400w, https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Lightning-Web-Component-Challenge-2-600x424.png 600w, https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Lightning-Web-Component-Challenge-2-768x543.png 768w, https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Lightning-Web-Component-Challenge-2-800x566.png 800w, https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Lightning-Web-Component-Challenge-2-1024x724.png 1024w, https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Lightning-Web-Component-Challenge-2-1200x848.png 1200w, https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Lightning-Web-Component-Challenge-2-1536x1086.png 1536w, https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Lightning-Web-Component-Challenge-2.png 2000w\" sizes=\"(max-width: 2000px) 100vw, 2000px\" \/><\/p>\r\n\r\n\r\n\r\n<p>A very basic component that would send a String to the server would look like this:<\/p>\r\n\r\n\r\n\r\n<h3><strong>Component<\/strong><\/h3>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>&lt;aura:component controller=\"myApexController\"&gt;<br \/>  &lt;aura:handler name=\"init\" value=\"{!this}\" action=\"{!c.callServer}\"\/&gt;<br \/>  &lt;aura:attribute name=\u201dmyAttribute\u201d type=\u201d<strong>String<\/strong>\u201d default=\u201dHello World\u201d\/&gt;<br \/>&lt;\/aura:component&gt;<\/code><\/pre>\r\n\r\n\r\n\r\n<h3><strong>JavaScript Client-side Controller<\/strong><\/h3>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>callServer : function(component, event, helper) {<br \/>  var myAttribute = component.get(\"v.myAttribute\");<\/code><\/pre>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>  var action = component.get(\"c.setAttribute\");<br \/>  action.setParams({ \"myString\" : myAttribute });<br \/>  action.setCallback(this, function(response) {<br \/><br \/>    var state = response.getState();<br \/>    if (state === \u201cSUCCESS\u201d) {<br \/>      \/\/ Do stuff<br \/>    } <br \/>    else {<br \/>      console.log(state);<br \/>    }<br \/>  });<\/code><\/pre>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>  $A.enqueueAction(action);<br \/>}<\/code><\/pre>\r\n\r\n\r\n\r\n<h3><strong>Apex Server-side Controller<\/strong><\/h3>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>@AuraEnabled<br \/>public static void setAttribute(<strong>String<\/strong> myString) {<br \/>  System.debug(myString);<br \/>}<\/code><\/pre>\r\n\r\n\r\n\r\n<p>As you would expect, the client-side attribute and the apex method parameter have the same type. On Lightning side, available <code>aura:attribute<\/code> types are listed <a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.lightning.meta\/lightning\/ref_aura_attribute.htm\" target=\"_blank\" rel=\"noopener\">here<\/a>. On server-side, well it\u2019s Apex, so you can make use of the types you\u2019re used to.<\/p>\r\n\r\n\r\n\r\n<p>However, using the same type client-side and server-side doesn\u2019t always work the way you would expect. If using a String, Boolean or DateTime (non-exhaustive list) is working fine, some other types have some glitches that may drive you crazy the first time you encounter them. Let\u2019s have a look.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Integer<\/h2>\r\n\r\n\r\n\r\n<p>Integer was the first type I encountered issues with. This is such a basic type that it took me some time to understand that it wasn\u2019t my code that had an issue, but the framework itself. Let\u2019s take the following example:<\/p>\r\n\r\n\r\n\r\n<h3><strong>Component<\/strong><\/h3>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>&lt;aura:attribute name=\u201dmyInteger\u201d type=\u201d<strong>Integer<\/strong>\u201d default=\u201d1\u201d\/&gt;<\/code><\/pre>\r\n\r\n\r\n\r\n<p><em>Note: I won\u2019t write again the JavaScript Client-side Controller, as it\u2019s only used to pass the value from the Component markup to the Apex server method, and would be exactly the same for all our examples.<\/em><\/p>\r\n\r\n\r\n\r\n<h3><strong>Server-side Controller<\/strong><\/h3>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>@AuraEnabled<br \/>public static void setInteger(<strong>Integer<\/strong> myInteger) {<br \/>  System.debug(myInteger);<br \/>}<\/code><\/pre>\r\n\r\n\r\n\r\n<p>You can run this code, have a look to the logs, and feel happy: your integer value will be displayed. Until you use it. Just add the following line to your Apex method:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>myInteger++;<\/code><\/pre>\r\n\r\n\r\n\r\n<p>If you run your code again, you\u2019ll see that it\u2019s crashing with an error server-side: <em>FATAL_ERROR Internal Salesforce.com Error<\/em>. This is because the myInteger parameter isn\u2019t casted correctly to an Integer by the framework. So you\u2019ll need to simply cast it again manually in your Apex code, and then everything will be fine:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>myInteger = Integer.valueOf(myInteger);<br \/>myInteger++;<\/code><\/pre>\r\n\r\n\r\n\r\n<p>This is a very easy workaround that can save you time if you encounter a strange behavior while using an Integer attribute. This is not only about doing maths on your attribute, but any other operation that needs an Integer and not a String. Another good example is using it inside an soql query, for a Limit for instance.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">sObjects<\/h2>\r\n\r\n\r\n\r\n<p>These are really important in Lightning, as you\u2019ll have to manipulate Salesforce objects all the time. Don\u2019t worry, they are working fine, and you can safely pass one sObject attribute from client-side to server-side.<\/p>\r\n\r\n\r\n\r\n<p>The only thing I\u2019ve noticed, is that relationships won\u2019t be available in the Apex method attribute: For instance, if you have a Account attribute, with a list of Contacts populated in the sObject, once in the Apex method<\/p>\r\n\r\n\r\n\r\n<p>On a side note, remember that with <a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.lightning.meta\/lightning\/data_service.htm\" target=\"_blank\" rel=\"noopener\">Lightning Data Service<\/a> you may not even have to query the server anymore to get the record you need.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Date<\/h2>\r\n\r\n\r\n\r\n<p>I was not able to use Date in an AuraEnabled method, the passed attribute always ends up being null:<\/p>\r\n\r\n\r\n\r\n<h3><strong>Component<\/strong><\/h3>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>&lt;aura:attribute name=\u201dmyDate\u201d type=\u201dDate\u201d default=\u201d1981\u201308\u201326\"\/&gt;<\/code><\/pre>\r\n\r\n\r\n\r\n<h3><strong>Server-side Controller<\/strong><\/h3>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>@AuraEnabled<br \/>public static void setDate(Date myDate) {<br \/>  System.debug(myDate); \/\/ --&gt; null<br \/>}<\/code><\/pre>\r\n\r\n\r\n\r\n<p>However, the workaround is pretty easy to implement, just pass the date as a string, and then cast it to a Date:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>@AuraEnabled<br \/>public static void setDate(String myDate) {<br \/>  Date myNewDate = Date.valueOf(myDate);<br \/>}<\/code><\/pre>\r\n\r\n\r\n\r\n<p>Again, this is easy to do, but you can lose some time just asking yourself what is wrong in your code and why the date is null in your Apex controller.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Apex Class<\/h2>\r\n\r\n\r\n\r\n<p>You can use an Apex class as an <code>aura:attribute<\/code> type. This can be convenient if you want to pass your data in a specific format while having a more structured way than just writing a json object manually. For instance, you\u2019ll need it if you want to use <a href=\"http:\/\/salesforce.stackexchange.com\/questions\/53596\/auraenabled-support-for-apex-class-return-types\" target=\"_blank\" rel=\"noopener\">SelectOption<\/a> at some point.<\/p>\r\n\r\n\r\n\r\n<p>Unfortunately, I was not able to make it work. Every time I tried I received the following error: <em>An internal server error has occurred<\/em>.<\/p>\r\n\r\n\r\n\r\n<h3><strong>Apex NewWrapperClass<\/strong><\/h3>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>public class NewWrapperClass {<br \/>  @AuraEnabled<br \/>  public String label {get; set;}<br \/>}<\/code><\/pre>\r\n\r\n\r\n\r\n<h3><strong>Component<\/strong><\/h3>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>&lt;aura:attribute name=\u201dmyApexClass\u201d type=\u201dNewWrapperClass\u201d \/&gt;<\/code><\/pre>\r\n\r\n\r\n\r\n<h3><strong>Client-side Controller<\/strong><\/h3>\r\n\r\n\r\n\r\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\r\n<pre class=\"wp-block-code\"><code>callServer : function(component, event, helper) {<br \/>  var myClass = component.get(\"v.myApexClass\");<\/code><\/pre>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>  var action = component.get(\"c.setApexClassType\");<br \/>  action.setParams({ \"myApexClass\" : myClass });<br \/>  action.setCallback(this, function(response) {<br \/>    \/\/ Do stuff<br \/>  });<\/code><\/pre>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>  $A.enqueueAction(action);<br \/>}<\/code><\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<h3><strong>Server-side Controller<\/strong><\/h3>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>@AuraEnabled<br \/>public Static void setApexClassType(NewWrapperClass myApexClass) {<br \/>  System.debug(myApexClass);<br \/>}<\/code><\/pre>\r\n\r\n\r\n\r\n<p>The best way I found to pass an Apex class to your AuraEnabled method is stringify it on client-side, and then deserialize it in Apex. The following code will work fine:<\/p>\r\n\r\n\r\n\r\n<h3><strong>Client-side Controller<\/strong><\/h3>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>callServer : function(component, event, helper) {<br \/>  var myClass = component.get(\"v.myApexClass\");<\/code><\/pre>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>  var action = component.get(\"c.setApexClassType\");<br \/>  action.setParams({ \"myApexClass\" : <strong>JSON.stringify(myClass)<\/strong> });<br \/>  action.setCallback(this, function(response) {<br \/><br \/>    var state = response.getState();<br \/>    if (state === \u201cSUCCESS\u201d) {<br \/>      \/\/ Do stuff<br \/>    } <br \/>    else {<br \/>      console.log(state);<br \/>    }<br \/>  });<\/code><\/pre>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>$A.enqueueAction(action);<br \/>}action.setParams({ wrap : <\/code><\/pre>\r\n\r\n\r\n\r\n<h3><strong>Server-side Controller<\/strong><\/h3>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>@AuraEnabled<br \/>public static void setApexClassType(String myApexClass) {<br \/>  NewWrapperClass nwc = (NewWrapperClass)<strong>JSON.deserialize(myApexClass, NewWrapperClass.class);<\/strong><br \/>}<\/code><\/pre>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Set<\/h2>\r\n\r\n\r\n\r\n<p>You won\u2019t be able to use a Set, but at least you won\u2019t have any surprise with this one. Try to save an AuraEnabled method with a parameter of type Set&lt;String&gt;, and you\u2019ll see the following error message, preventing you to save: <em>Parameter type does not support AuraEnabled: Set&lt;String&gt;<\/em>.<\/p>\r\n\r\n\r\n\r\n<p>List and Map are working perfectly though.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Bonus tip:\u00a0base64<\/h2>\r\n\r\n\r\n\r\n<p>This is something that is not specific to Lightning, but that may be useful if you want to pass a file to your Apex method. Don\u2019t forget to encode\/decode the file:<\/p>\r\n\r\n\r\n\r\n<h3><strong>Client-side Controller<\/strong><\/h3>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>var action = component.get(\"c.setFile\");<br \/>action.setParams({ myBase64File : <strong>encodeURIComponent(base64File)<\/strong> });<br \/>action.setCallback(this, function(response) {<br \/><br \/>  var state = response.getState();<br \/>  if (state === \u201cSUCCESS\u201d) {<br \/>    \/\/ Do stuff<br \/>  } <br \/>  else {<br \/>   console.log(state);<br \/>  }<br \/>});<br \/>$A.enqueueAction(action);<\/code><\/pre>\r\n\r\n\r\n\r\n<h3><strong>Server-side Controller<\/strong><\/h3>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>@AuraEnabled<br \/>public static void setFile(String myBase64File) {<br \/>  String myFile = EncodingUtil.urlDecode(myBase64File, \u2018UTF-8\u2019);<br \/>}<\/code><\/pre>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Wrapping up<\/h2>\r\n\r\n\r\n\r\n<p>Lightning is still a young framework, and I\u2019m sure most of the strange behaviors described here will be fixed in the future. However in the meantime, I hope this will help some of you save the time I\u2019ve lost when I encountered them.<\/p>\r\n\r\n\r\n\r\n<p>Also, if you\u2019ve seen some other weird things I would have missed with other types, please feel free to add them in the comments.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Passing values from client-side to server-side is an important part of Lightning Component Development, and is pretty easy once you understood the way to write it. In\u00a0theory. Passing a value to a server-side controller Let\u2019s take a very simple example of a server-side call in a Lightning Component. There is 3 parts in this call: [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":5256,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[300],"tags":[],"class_list":["post-110","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advices"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Lightning Components &amp; AuraEnabled method parameters: What\u2019s working and what\u2019s not - Texe\u00ef<\/title>\n<meta name=\"description\" content=\"Passing values from client-side to server-side is an important part of Lightning Component Development, and is pretty easy once you ...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Lightning Components &amp; AuraEnabled method parameters: What\u2019s working and what\u2019s not\" \/>\n<meta property=\"og:description\" content=\"Passing values from client-side to server-side is an important part of Lightning Component Development, and is pretty easy once you ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/\" \/>\n<meta property=\"og:site_name\" content=\"Texe\u00ef\" \/>\n<meta property=\"article:published_time\" content=\"2017-04-10T12:07:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-16T13:14:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Work_challenges_2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1440\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Fabien Taillon\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\\\/\"},\"author\":{\"name\":\"Fabien Taillon\",\"@id\":\"https:\\\/\\\/texei.com\\\/#\\\/schema\\\/person\\\/082ce6d13635571cae4161f1d4f5a9a7\"},\"headline\":\"Lightning Components &#038; AuraEnabled method parameters: What\u2019s working and what\u2019s not\",\"datePublished\":\"2017-04-10T12:07:43+00:00\",\"dateModified\":\"2023-08-16T13:14:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\\\/\"},\"wordCount\":928,\"publisher\":{\"@id\":\"https:\\\/\\\/texei.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2017\\\/04\\\/Work_challenges_2.png\",\"articleSection\":[\"Advices\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\\\/\",\"url\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\\\/\",\"name\":\"Lightning Components & AuraEnabled method parameters: What\u2019s working and what\u2019s not - Texe\u00ef\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/texei.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2017\\\/04\\\/Work_challenges_2.png\",\"datePublished\":\"2017-04-10T12:07:43+00:00\",\"dateModified\":\"2023-08-16T13:14:29+00:00\",\"description\":\"Passing values from client-side to server-side is an important part of Lightning Component Development, and is pretty easy once you ...\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\\\/#primaryimage\",\"url\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2017\\\/04\\\/Work_challenges_2.png\",\"contentUrl\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2017\\\/04\\\/Work_challenges_2.png\",\"width\":1440,\"height\":1080,\"caption\":\"Illustration d'une employ\u00e9e qui travaille sur ordinateur\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/texei.com\\\/en\\\/advices\\\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/texei.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Advices\",\"item\":\"https:\\\/\\\/texei.com\\\/en\\\/category\\\/advices\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Lightning Components &#038; AuraEnabled method parameters: What\u2019s working and what\u2019s not\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/texei.com\\\/#website\",\"url\":\"https:\\\/\\\/texei.com\\\/\",\"name\":\"Texe\u00ef\",\"description\":\"Turn your IT into Business\",\"publisher\":{\"@id\":\"https:\\\/\\\/texei.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/texei.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/texei.com\\\/#organization\",\"name\":\"Texe\u00ef\",\"url\":\"https:\\\/\\\/texei.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/texei.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/logo-essai-1.jpg\",\"contentUrl\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/logo-essai-1.jpg\",\"width\":2560,\"height\":1102,\"caption\":\"Texe\u00ef\"},\"image\":{\"@id\":\"https:\\\/\\\/texei.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/texei.com\\\/#\\\/schema\\\/person\\\/082ce6d13635571cae4161f1d4f5a9a7\",\"name\":\"Fabien Taillon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/avatar_user_5_1766076207-96x96.png\",\"url\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/avatar_user_5_1766076207-96x96.png\",\"contentUrl\":\"https:\\\/\\\/texei.com\\\/dev\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/avatar_user_5_1766076207-96x96.png\",\"caption\":\"Fabien Taillon\"},\"url\":\"https:\\\/\\\/texei.com\\\/en\\\/author\\\/fabient\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Lightning Components & AuraEnabled method parameters: What\u2019s working and what\u2019s not - Texe\u00ef","description":"Passing values from client-side to server-side is an important part of Lightning Component Development, and is pretty easy once you ...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/","og_locale":"en_US","og_type":"article","og_title":"Lightning Components & AuraEnabled method parameters: What\u2019s working and what\u2019s not","og_description":"Passing values from client-side to server-side is an important part of Lightning Component Development, and is pretty easy once you ...","og_url":"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/","og_site_name":"Texe\u00ef","article_published_time":"2017-04-10T12:07:43+00:00","article_modified_time":"2023-08-16T13:14:29+00:00","og_image":[{"width":1440,"height":1080,"url":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Work_challenges_2.png","type":"image\/png"}],"author":"Fabien Taillon","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/#article","isPartOf":{"@id":"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/"},"author":{"name":"Fabien Taillon","@id":"https:\/\/texei.com\/#\/schema\/person\/082ce6d13635571cae4161f1d4f5a9a7"},"headline":"Lightning Components &#038; AuraEnabled method parameters: What\u2019s working and what\u2019s not","datePublished":"2017-04-10T12:07:43+00:00","dateModified":"2023-08-16T13:14:29+00:00","mainEntityOfPage":{"@id":"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/"},"wordCount":928,"publisher":{"@id":"https:\/\/texei.com\/#organization"},"image":{"@id":"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/#primaryimage"},"thumbnailUrl":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Work_challenges_2.png","articleSection":["Advices"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/","url":"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/","name":"Lightning Components & AuraEnabled method parameters: What\u2019s working and what\u2019s not - Texe\u00ef","isPartOf":{"@id":"https:\/\/texei.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/#primaryimage"},"image":{"@id":"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/#primaryimage"},"thumbnailUrl":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Work_challenges_2.png","datePublished":"2017-04-10T12:07:43+00:00","dateModified":"2023-08-16T13:14:29+00:00","description":"Passing values from client-side to server-side is an important part of Lightning Component Development, and is pretty easy once you ...","breadcrumb":{"@id":"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/#primaryimage","url":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Work_challenges_2.png","contentUrl":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2017\/04\/Work_challenges_2.png","width":1440,"height":1080,"caption":"Illustration d'une employ\u00e9e qui travaille sur ordinateur"},{"@type":"BreadcrumbList","@id":"https:\/\/texei.com\/en\/advices\/lightning-components-auraenabled-method-parameters-whats-working-and-whats-not\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/texei.com\/"},{"@type":"ListItem","position":2,"name":"Advices","item":"https:\/\/texei.com\/en\/category\/advices\/"},{"@type":"ListItem","position":3,"name":"Lightning Components &#038; AuraEnabled method parameters: What\u2019s working and what\u2019s not"}]},{"@type":"WebSite","@id":"https:\/\/texei.com\/#website","url":"https:\/\/texei.com\/","name":"Texe\u00ef","description":"Turn your IT into Business","publisher":{"@id":"https:\/\/texei.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/texei.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/texei.com\/#organization","name":"Texe\u00ef","url":"https:\/\/texei.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/texei.com\/#\/schema\/logo\/image\/","url":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2021\/03\/logo-essai-1.jpg","contentUrl":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2021\/03\/logo-essai-1.jpg","width":2560,"height":1102,"caption":"Texe\u00ef"},"image":{"@id":"https:\/\/texei.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/texei.com\/#\/schema\/person\/082ce6d13635571cae4161f1d4f5a9a7","name":"Fabien Taillon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2025\/12\/avatar_user_5_1766076207-96x96.png","url":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2025\/12\/avatar_user_5_1766076207-96x96.png","contentUrl":"https:\/\/texei.com\/dev\/wp-content\/uploads\/2025\/12\/avatar_user_5_1766076207-96x96.png","caption":"Fabien Taillon"},"url":"https:\/\/texei.com\/en\/author\/fabient\/"}]}},"_links":{"self":[{"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/posts\/110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/comments?post=110"}],"version-history":[{"count":0,"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/posts\/110\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/media\/5256"}],"wp:attachment":[{"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/media?parent=110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/categories?post=110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/texei.com\/en\/wp-json\/wp\/v2\/tags?post=110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}