Questions tagged [aura-enabled]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
30 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 ...
1
vote
1answer
19 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 ...
1
vote
1answer
33 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 ...
0
votes
0answers
19 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 ...
0
votes
0answers
18 views

Interactive Apex Debugger for Aura Enabled functions - VS Code

I have managed to set up the Apex Interactive Debugger and can sometimes see the break point being triggered depending on what I am doing. I can see my own actions and everyone else's request via my ...
0
votes
1answer
80 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 {"...
0
votes
1answer
36 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 ...
0
votes
1answer
33 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 ...
0
votes
2answers
49 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 ...
0
votes
1answer
637 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, ...
0
votes
2answers
260 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 ...
0
votes
1answer
43 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 ...
0
votes
2answers
896 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(...
2
votes
1answer
884 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: &...
1
vote
1answer
125 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 ...
5
votes
1answer
325 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 ...
2
votes
3answers
478 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 ...
1
vote
2answers
58 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'; ...
0
votes
2answers
64 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 ...
7
votes
1answer
310 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 ...
0
votes
0answers
57 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 ...
3
votes
1answer
333 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. ...
9
votes
0answers
3k 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 ...