
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.
2 comentarios
If you want to update only the current record, you may want to have a look to Lightning Data Service (in Beta in Summer '17): https://developer.salesforce.com/docs/atlas.en-us.208.0.lightning.meta/lightning/data_service.htm