I am having trouble Saving data through Apex I send to Apex a dict that have different Data type such as {"id": 12345, "field_name":44}
now what I would like to do is
- send this data to Apex
- Get the specific lead via the Id
- update the fields
@AuraEnabled
public static void UW_SavedData(Map<String, Object> record){
if(record != null){
string currentId = record.id;
Lead CurrentProp = [SELECT Id FROM Lead WHERE Id = :record.id];
}
}
My apex look the following ..
my issue is that for :record.id I get the error Variable does not exist: id
Could you explain me what I am doing wrong ?
edited Code:
@AuraEnabled
public static void UW_SavedData(Lead record){
if(record != null){
Id currentId = record.get('Id');
Lead CurrentProp = [SELECT Id FROM Lead WHERE Id = :currentId];
}
}