You need to sign in to do that
Don't have an account?
Another Approach for Getting the Apex(Server side Controller) returned value in Lightning
Can you tell me what are the other approaches for getting the Apex(Server Side Controller) in Lightning. The Only one i know is the data.getReturnedValue(). What i want is to avoid Merging the duplicate records. For Example the apex returned a list with the same element value {marvin,marvin}. The data.getReturnedValue() will return only 1 marvin. and What i want is to return all the element value eventhough there are duplicate records.
JS CLIENT SIDE CONTROLLER
({
doInit : function(component, event, helper)
{ var action = component.get("c.GetallContacts");
action.setCallback(this, function(data){
component.set("v.events", data.getReturnValue()); ////<------------This Line I only know to retrieve the apex serverside controller returned value
});
$A.enqueueAction(action);
},
})
SERVER SIDE CONTROLLER
Public Static List<Contact> GetallContacts(){
List<Ticket__c> ids = TicketIDget();
Set<String> newids = new Set<String>();
for(integer i=0; i<ids.size(); i++)
{
newids.add(ids[i].Booker__c);
}
return [SELECT Name FROM Contact WHERE Id IN:newids];
}