New answers tagged

2

You've got a lot of errors in your code. Without changing your Apex at all, here's what your JavaScript should look like: import { LightningElement } from 'lwc'; import createTransaction from '@salesforce/apex/MyClass.createTransaction'; export default class MyComponentName extends LightningElement { onButtonClick() { const msg = { ...


2

2 things, You have written method name as createTransaction in apex where as you are importing test method. You have to import proper method. import createTransaction from '@salesforce/apex/MyClass.createTransaction'; Secondly, the parameter name in apex and in lwc should match. In Apex the variable name is req where in your js you have used request , ...


Top 50 recent answers are included