function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RajnisfRajnisf 

connectApi apex class access in aura lightning component

Hi Guys,

If anyone of you have worked on connectApis please help me to provide the sample code how we can access apex connectApi method in lightning.

I found example code for apex
https://gist.github.com/martyychang/9175b4e9c64cf7a14cd3b1571bf645d4

how can i use this in lightning component?


Thanks
AnudeepAnudeep (Salesforce Developers) 
The example you have provided has @auraenabled annotation

The AuraEnabled annotation enables Lightning components to access Apex methods and properties.

For sample code to learn how to use this in lightning component, see the following documentation

Using Apex to Work with Salesforce Records

Let me know if this helps, if it does, please mark this answer as best so that others facing the same issue will find this information useful. Thank you