Questions tagged [aura-enabled]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
29 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
39 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
48 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
148 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
22 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
61 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
402 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
69 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
152 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
242 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
36 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
57 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
152 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
25 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
161 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 ...