Skip to main content

Questions tagged [aura-enabled]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
59 views

SOQL used in aura enabled method returns values in user's language

SELECT Profile.Name FROM User WHERE Id = :userId LIMIT 1returns Profile.Name in user's languague. The query is placed inside aura enabled method. For ex. an user with language set up as Dutch returns ...
Borz998's user avatar
  • 101
1 vote
2 answers
313 views

LWC referencing error information in Apex callout failure

I'm doing a callout from my LWC js controller to an @AuraEnabled method in my Apex controller. It works successfully but I also need to handle errors. I added temporary code throw an Exception in ...
Ken's user avatar
  • 450
0 votes
1 answer
182 views

Aura: calling an AuraEnabled method multiple times and waiting for it to finish

I have an AuraEnabled method which does a callout. I'd like to call this multiple times from my Aura component. How can I do this and then execute code after all of them have finished? I tried doing $...
fred's user avatar
  • 3,414
0 votes
0 answers
387 views

How to test a function that does a callout from another function?

In the code below, I'm calling GetBusinessDetails, which does a callout, from another function. The problem is, the lines with the asterisks are not getting hit when I run a test and that lowers the ...
Burak's user avatar
  • 135
0 votes
0 answers
192 views

RestResource to convert Apex-Defined Data Type for Flow Interview

I am attempting to use Flow as a low-code API development platform. The plan is to expose an endpoint with a RestResource, convert the request to an Apex-Defined variable, pass to a Flow and let the ...
Xtremefaith's user avatar
  • 4,570
-4 votes
2 answers
76 views

How to change this method into @auraEnable method

public PageReference back() { PageReference pgRef = new PageReference('/' + oppId); return pgRef; }
user110347's user avatar
2 votes
1 answer
786 views

Lightning: Need help understanding @AuraEnabled(cacheable=true)

Going through the Developer Guide I found this statement. To set cacheable=true, a method must only get data. It can’t mutate data. Does data mutation only refer to DML operations? I have a method ...
Prapti's user avatar
  • 45
1 vote
1 answer
1k views

AuraEnabled function gets not value from lwc using class type as parameter

i have the following object: public class myType { public String name {get; set;} public String fields {get; set;} public Integer page {get; set;} public Integer pageSize { get; set; } } ...
Sarabion's user avatar
2 votes
0 answers
1k views

Aura component unable to find apex controller method

This problem is going on and on on my orgs. I use VS code as my IDE and whenever I deploy a freshly written @AuraEnabled method in a controller, for some time my org does not seem to recognize it. I ...
yakee-niyakee's user avatar
0 votes
1 answer
1k views

Display record detail of child record in parent record's aura lightning component

I am designing a custom lightning component to display a list of OrderItem records in a tabular format on parent Order record detail page. The requirement is to display the record detail page of an ...
user51241's user avatar
0 votes
1 answer
2k views

Illegal assigment from Object to String

I'm trying to update a field with the OldValue, but I'm receiving the following error: Illegal assigment from Object to String @AuraEnabled public static String updateRecordAfterReturned(Id ...
Sabrina T.'s user avatar
2 votes
1 answer
3k views

Problem passing a wrapper class from LWC to Apex

I am having trouble passing an apex wrapper class from LWC into APEX. Apex @AuraEnabled public static void myMethod(SomeData theData) { system.debug('theData is ' + theData); } public class ...
Arthlete's user avatar
  • 4,957
1 vote
1 answer
188 views

List has no rows for assignment exception on AuraEnabled method

I have created an Apex Class with an AuraEnabled method, which I am calling from a Lightning component. After the method is called I am receiving the below error. There was an exception List has no ...
Akshay Vasu's user avatar
0 votes
0 answers
305 views

Is there a way to invoke AuraEnabled methods form browser's dev tools?

as title states I am looking for a way to invoke aura enabled functions by using only browser capabilities not via javascript written inside org, especially in lwc context. In the end when we add a ...
oozkan's user avatar
  • 581
0 votes
1 answer
646 views

lightning:tabClosed event throwing error when calling apex method

I am calling apex method on lightning:tabClosed event to update a record on closing the tab. I can see the record Id being passed to controller method but query is throwing an error saying {"...
SunnyG's user avatar
  • 421
0 votes
1 answer
215 views

Test data not visible by Dynamic SOQL

I have an seemingly simple aura enabled class for agreement lookup which returns maximum 8 records using dynamic SOQL. This class works fine from UI perspective. No issues so far while testing. My ...
kumar's user avatar
  • 76
0 votes
1 answer
51 views

AuraEnabled Apex Class Returning Following Error: System.QueryException: List has no rows for assignment to SObject

In my following AuraEnabled class, I am trying to clone the current record displayed in my lightning component page. This lightning component implements force:hasRecordId and should insert it as new ...
Ertyq's user avatar
  • 331
0 votes
2 answers
119 views

List has no rows for assignment to SObject when cloning record

I an encountering the following error in my Auraenabled apex class: List has no rows for assignment to SObject I am aware that this occurs if the query doesn't return any rows, so I included a null ...
lol's user avatar
  • 93
2 votes
1 answer
3k views

LWC pass date to @wire apex - how to initialise date variable?

I have a component that on first load should display all accounts where a last verified date is 2 years or older. The component has a date selection field where the user can select a different date, ...
Irene's user avatar
  • 1,849
0 votes
2 answers
437 views

Critical update not activated but is past the Auto activation date and no Activate button is available

In my dev org, these two critical updates haven't been activated by admins within the Auto activation date. So as per salesforce, shouldn't this be activated automatically? As the screenshot reads ...
Sowparnika's user avatar
0 votes
1 answer
179 views

Previously annotated identifier with @AuraEnabled(cacheable=true) must still be annotated: AuraEnabled(cacheable=true)

I am getting this error when I tried to remove the cacheable=true from the below method. @AuraEnabled(cacheable=true) global static boolean packageNotExpired() { /// my code; } Previously ...
Rahul Gawale's user avatar
  • 12.2k
0 votes
2 answers
8k views

MIXED_DML_OPERATION, DML operation on setup object is not permitted Contact User

Hi i have a problem cuz I'm trying do sth like below: this method has adnotation AuraEnabled Contact contact = getContact((Id)contactId); contact.Inactive__c = true; User user = getUserByContactId(...
artist's user avatar
  • 145
2 votes
1 answer
3k views

Getting results 'undefined' in LWC from Apex call

I've simplified my code drastically to try and get to the bottom of what's wrong, but I'm still getting the 'undefined' result and am at my wit's end. This is in my html which triggers the event: &...
Irene's user avatar
  • 1,849
1 vote
1 answer
568 views

Is it safe to directly return a SOQL query from a AuraEnabled Apex method

Is it safe to directly return a SOQL query from a AuraEnabled Apex method like this: @AuraEnabled(cacheable=true) public static List<Opportunity> getRecords() { return [SELECT ... FROM ...
Robs's user avatar
  • 9,396
5 votes
1 answer
799 views

Can an @AuraEnabled method be added in a managed package patch release?

I have a managed package with an LWC component. I need to enhance this LWC in a patch to allow it to receive some additional data during its initialization, which is done using an @wire. The data ...
Phil W's user avatar
  • 37k
3 votes
3 answers
1k views

AuraEnabled Method Causes Internal Server Error for non-Admin Profile

I have an Aura Enabled method in my class that accepts a Case record and a list of a related object records and inserts both of them. The code works fine when I'm logged in as the admin, but the ...
nbrown's user avatar
  • 4,043
1 vote
2 answers
284 views

Store reference to an AuraEnabled Apex method in a JS property

Is it possible to store a dynamic reference to an AuraEnabled Apex method in the LWC JavaScript controller? Something like this: import myMethodA from '@salesforce/apex/MyController.myMethodA'; ...
Mossi's user avatar
  • 3,986
0 votes
2 answers
79 views

Problem with unit test and Custom Setting with @AuraEnabled

There was a problem writing a unit test. I tried to use the usual HttpRequest and Mosk, but they do not work with Costom Setting. Here is my controller and test, which does not completely cover the ...
Алёна Опарина's user avatar
7 votes
1 answer
984 views

Good way to offer both LWCs and a REST API in the same code?

We are building a product that will make use of multiple Lightning Web Components (LWCs), and some of those will make use of @AuraEnabled Apex methods. We also plan to provide an API that non-LWC UI ...
Keith C's user avatar
  • 136k
0 votes
0 answers
192 views

Aura Enabled Apex Action - param not getting set

I am using action.setParams, but when I check the params they are not being set. I'm not getting any error messages, the variable I'm using to populate the parameter is populated, but when I check ...
eaeaoo's user avatar
  • 928
3 votes
1 answer
807 views

How can i create a Map for unrelated objects?

Background We create shadow records for Contacts that are Inactive (record type) and I am working on building a UI for the user to Activate one or more shadow records associated to that Account. ...
SunnyG's user avatar
  • 421
9 votes
0 answers
4k views

Winter '20 Critical Update "Restrict Access to @AuraEnabled Apex Methods for Authenticated Users Based on User Profile"

I was wondering if somebody has already dealt with this critical update: When this critical update is activated, an authenticated user can access an @AuraEnabled Apex method only when the user’s ...
Arthlete's user avatar
  • 4,957