• Tara Hamond
  • NEWBIE
  • 5 Points
  • Member since 2015
  • Director of Development
  • Stratus Hub


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I am building a custom lightning component for the Napili Community to replace the headline component that it uses by default. Similarly, the new headline will display the list of sub topics for the topic page that the user is currently on and allow them to navigate to those links.

I am using a click action with this function:
 
onClickTopic: function(component, event, helper) {
        var id = component.get("v.subtopic.TopicId");
        console.log("id: " + id);
        
        var urlEvent = $A.get("e.force:navigateToURL");
        urlEvent.setParams({ "url": "/" + id });
        
      urlEvent.fire();
    },

It fires the navigateToUrl event and passes the topic id in the url.  Weirdly, this always loads the license list view.  As I need it to load the topic, does anyone know what I'm doing wrong? I also tried the navigateToSObject event but wasn't able to get that working either. I'm sure that the community template has a built in event that I could fire but I can't find any documentation on it.

Thanks in advance for anyone who can assist!
Hi guys, I have been trying to write a trigger to convert lead if someone changes its status to closed converted the code is:
trigger convertlead on Lead ( after update ,after insert) {

list<lead> mylead= trigger.new;
for(lead l : mylead)
{
    if(l.status=='Closed - Converted')
    {
      
   
        Database.LeadConvert lc = new Database.LeadConvert();
    
    lc.setConvertedStatus('Closed - Converted');
    lc.setLeadId(l.id);



Database.LeadConvertResult lcr = Database.convertLead(lc);
System.debug(lcr.isSuccess());
  } 
}
}
its giving follwoing error:
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger WkAbhi.convertlead caused an unexpected exception, contact your administrator: WkAbhi.convertlead: execution of AfterUpdate caused by: System.DmlException: ConvertLead failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, System.DmlException: Update failed. First exception on row 0 with id 00Q28000001ovz7EAA; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, WkAbhi.convertlead: execution of AfterUpdate caused by: System.DmlException: ConvertLead failed. First exception on row 0; first error: CANNOT_UPDATE_CONVERTED_LEAD, cannot reference converted lead: [] Trigger.WkAbhi.convertlead: line 17, column 1: [] (System Code) : []: Trigger.WkAbhi.convertlead: line 17, column 1


Please help....