Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [imperativeapex]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-3 votes
1 answer
46 views

Calling apex method with AuraEnabled in LWC

I need to call an apex method from a class I don't have access to modify and mark it @auraEnabled. I know it's generally not supported as per documentation. But through imperative apex, is it possible ...
goose's user avatar
  • 81
0 votes
0 answers
44 views

Not able to fetch data from apex imperitively to lwc

In javascript file the file is not able to call the apex method, getbankinfo. it is failing and the logic is moving to catch. JS: // transactionRecordForm.js import { LightningElement, track } from '...
anjum tadmod's user avatar
3 votes
4 answers
374 views

How to detect Salesforce UI navigation in an LWC

I have an LWC that adds a timer (in connectedCallback) for periodic polling of an imperative apex API in order to do some processing related to the given context (which might be a given record, when ...
Phil W's user avatar
  • 36.7k
-2 votes
1 answer
309 views

Apex wrapper variable with null values are not returning in LWC [closed]

I have an apex method which is returning Wrapper List.Some of the Wrapper Variables has values as null.Those null values and there variable names are not returning in LWC. Wrapper Data: [AccountNo = ...
Hira Khan's user avatar
-1 votes
1 answer
76 views

How to use imperative apex from Salesforce Sites?

I am surfacing a LWC on Salesforce Sites however, I am not able to implement imperative apex from a button click. When I add the same LWC to a record page in Salesforce and click the button, then the ...
Andy Hitchings's user avatar
1 vote
1 answer
271 views

Gack Error Id : 2020409769-104966 (551437190) when there is no constructor without parameters

When a Lightning Action is called from LWC and a DTO model instance is passed, where the corresponding DTO Model class doesn't have no arguments constructor, an internal error is shown: Gack Error Id ...
Patlatus's user avatar
  • 17k
0 votes
1 answer
1k views

How to loop each list's column and assign them to an array (LWC)

I have a list returned from apex (imperative). How can I loop through each column and assign them to an array in js? I can't seem to populate the arrays properly. I can get the results but I cannot ...
Sheen's user avatar
  • 23
1 vote
1 answer
194 views

recordId is blank in imperative call

I have an lwc action button that loads the popup. When i load the component for first time, recordId is present. But when i close and open it again(without reloading the whole page), recordId is lost. ...
SFDC coder's user avatar
1 vote
1 answer
544 views

I'm trying to call method Imperatively based on the wired result but not getting result

I have one LWC component. In my JS file, I'm trying to call one apex method imperatively as it is not cache enabled, based on the result of wired method. I'm not receiving the result of my wired ...
salesforce Developer's user avatar
0 votes
1 answer
109 views

Too many DML Statements: 1 In LWC

I've been trying to research on how to solve this issue but it doesn't seem like I've been having much luck. I've cut out all of the additional functionality so that it only remains with a single ...
Kevin Yao's user avatar
  • 117
0 votes
0 answers
494 views

refresh datatable data in lwc while using imperative method

I have used the Braintree payment gateway to payments on 'Order' object. For this I have created the datatable to fetch the 'TotalAmount' field from the particular record and I'm calling it ...
user avatar
0 votes
1 answer
475 views

Calling Apex function results in a "default(...).this is not a function" error, a similar function works perfectly

Previous functions I wrote which called Apex classes (see the below) work fine. New ones (one example included) do not, I do not see why. The second call throws the following error in a try/catch: &...
SFD's user avatar
  • 35
3 votes
1 answer
2k views

Error calling Apex imperatively from LWC in a JavaScript method. Error gotten -> [F.default(...).then(...).error is not a function],

This is the import statement on my LWC import checkSize from '@salesforce/apex/XFiles.checkSize'; This is what the function looks like on my lwc handleCheckingFileSize(fileId) { let resultSize = {...
Feggy's user avatar
  • 33
0 votes
2 answers
448 views

Imperative Apex call under guest user results in List has no rows for assignment to SObject, anonymous execution works fine

I have the following Apex Method which is called in the Experience Cloud under unauthenticated guest user: @AuraEnabled(cacheable=true) public static string test(String ref) { try { ...
Jessica's user avatar
  • 155
0 votes
1 answer
884 views

unescape String APEX

Premise: I have a list of string which I have to pass it from LWC to APEX and in APEX I have to put this List in SOQL where clause to get the data. Finally I have to return the SOQL result list back ...
user43598's user avatar
  • 487
1 vote
1 answer
2k views

Apex Method Overloading is not working when called from LWC javascript Controller

Recently i have observed this weird behaviour and i am not sure is this expected behaviour or i am doing some kind of syntactical error. I have two method with same name(suppose "methodOfClassA&...
Ranjit Mishra's user avatar
0 votes
1 answer
389 views

Typecast/Assign data from event.detail or event.target to Salesforce custom object

I am trying to pass Salesforce object record to imperatively called apex method. Javascript method is being called from onsubmit of record-edit-from, which in turn calls apex method. But assignment ...
user3030605's user avatar
1 vote
0 answers
33 views

`ldsNetwork.js` error when performing imperative APEX call

I have a very strange issue with one of my imperative APEX call, I get the following error : Here is my calling code : const dto = { listId: this.selectedListId, name: ...
Ombrelin's user avatar
  • 413
3 votes
2 answers
5k views

Display error in toast from imperative call

I am trying to show the error message from the apex method exception as a toast message while doing imperative call in lwc. I am using ldsUtil.js to simplify the error message. But either way, I am ...
Akash's user avatar
  • 361
5 votes
2 answers
2k views

passing object from LWC to Apex not working as expected (Class does not have no-arg constructor error)

JS: import { LightningElement } from 'lwc'; import startFlow from '@salesforce/apex/ExerciseOrchestrator.startFlow'; export default class ClientOperator extends LightningElement { firstName = ''; ...
ionut.baltariu's user avatar
4 votes
1 answer
3k views

LWC Jest test fails when testing data returned after apex imperative call

I believe it is a simple fix, but I am new to everything and Jest being the latest one I am exposed to. I am trying to test if the lightning-combobox received the data to fill its options after the ...
sumchans's user avatar
  • 777
1 vote
1 answer
3k views

LWC Imperative APEX with Parameters not taking Ids

I'm creating a LWC QuickAction. From a lookup field for accounts I need to fetch the external Id of the Account. I get the account ID from the lookup, but when I pass them to APEX, I get Error 500, ...
RRI's user avatar
  • 144
-1 votes
1 answer
2k views

Unable to insert contact record on button click using lwc and apex controller [closed]

Button is created in quick action bar on an account record. HTML FILE <template> <lightning-card title="New contact" icon-name="standard:contact"> <...
user13956399's user avatar
2 votes
3 answers
3k views

@track decorated property not updating LWC after imperative call

I can't seem to figure out what I am missing. I have a component that is supposed to display data after it receives an id of the exact record hence I am using an imperative call. I can see in the log ...
Pauline's user avatar
  • 375
0 votes
1 answer
1k views

How to refresh Related records & get the latest Count in LWC

I have a LWC Component added on Case object. Purpose of the component is to Change Ownership of the records and updates other fields on Case object. Once Ownership is changed, I have trigger which ...
SFDCDJ's user avatar
  • 1,864
12 votes
3 answers
7k views

LWC + Jest: Mocking imperative Apex and returning a value

I'm going to do a Q&A-style entry here, since I couldn't find anything on the web describing this use case. I have seen several threads here describing how to do an empty mock on an Apex call in ...
Matthew Souther's user avatar