• Danryl Carpio 8
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

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];
    }

 

Built few lightning components for listing records,redirecting to particular record detail after clicking from the list view, add new record and redirecting between these components with e.force.navigateToComponent event. This worked for few days but not working now. I looked into it did not able to found the issue. May be its because their version automatically changed to 34 previously it was 33. Please suggest.

Thanks and Regards
Anshuman Chauhan