Skip to main content

Hi ,

 

I saw in trailhead that I must create a Server-Side Controller to get or save any record in our org. So I need to get a current record Id in this Server-Side Controller but I can't do it ! (This is because of "@auraenabled" ? )

 

The method below doesn't work :

 

public with sharing class myClass{

 

@AuraEnabled

public static Lead getLead() {

 

return [SELECT Website, Phone FROM Lead WHERE Id = :ApexPages.currentPage().getParameters().get('id')];

 

}

 

}

 

Thanks.

#JS_Alternatives 

2 comentarios
0/9000