• Bharat.Sharma
  • NEWBIE
  • 75 Points
  • Member since 2016
  • Sales force Developer
  • MiriInfotech

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 9
    Questions
  • 20
    Replies
Hello guys im new to apex triggers.
I have 2 objects, standard (Contract) and costum (soccerplayers__c).
I want to create a trigger that updates Contracts start date in soccerplayers__c based on the value i puted in Contracts.
I am trying to compare the different contracts based on the players name, i have a lookup between the two objects.
The Name field on contract is (player_represented_by__c) and on soccerplayers__c is (Name). Ps: this is the name of the lookup fields.
If i didn´t express myself right you can ask me, i will try to answer.

 
Hello, I am working on lightning component and stuck on scenario is there any way to switch one lightning component to another component when both are in different lightning pages.  
Please Help Me.
Thanks In Advance. :)
Hello, i have system admin profile and Campaign influence related list Showing in Opportunity Detail page but there is no option to enable Campaign Influence. even i can't access the Setings of Campaign Influence.User-added image
It has been a long time I am facing an issue in my lightening component. 
I am building a lightning component and I am facing some issue please help me to getting out of there.
Exact Scenario is that I have created a calendar that is lightening component in which I have use a normal JavaScript in HELPER.js for creating a dynamic HTML element.
And it is working fine. when I am applying this component to detail page of Lead object layout, it is getting load first time correctly but when I am switch lead from lead tabs (to another Record) it requires a manual reload.
 
Please refer the image for more details. Please help me.

Image 1image 2image 3


Thank you in Advance.
 
I am looking for help to Create a test class for my trigger.
when leads enter in database and associate with a camapign,i want to add that campaign as a campaigninfluence (opportunity related list) record in opportunity when lead is converted. Number of campaign may be more then one.
like..
A lead associate with  campaign 'A' to the time of creation and get added with one or more campaign after the creation so we have multiple campaign in "Campaign history" . when lead convert into a opportunity , i want to add  that campaigns as campaign influence in Opportunity  related list (Campaign influence).
first campaign
first campaign of lead should have 100% influence and rest of them must have 0% influence.
Trigger--
trigger Add_as_Campaigninfluence on Lead ( After update)  {
    map <Opportunity,Id> OppsAndContacts = new map <Opportunity,Id>(); 
    Campaigninfluence[] C = new list<Campaigninfluence>();
    //List <CampaignMember> cmm =[SELECT CampaignId FROM CampaignMember WHERE ContactId = :l.convertedcontactid ORDER BY CreatedDate ASC NULLS FIRST];
    Integer i=0;
    for (Lead l : Trigger.new) {
        If(l.IsConverted){ 
            Opportunity Opp = [SELECT Id from Opportunity where Id = :l.convertedopportunityid];
            OppsAndContacts.put(Opp, l.ConvertedContactID);
        }
        List <CampaignMember> cmm =[SELECT CampaignId FROM CampaignMember WHERE ContactId = :l.convertedcontactid ORDER BY CreatedDate ASC NULLS FIRST];
        for(CampaignMember ii:cmm)
        {
            if(i==0)
            {
                Campaigninfluence ci =new Campaigninfluence();
                ci.CampaignId =ii.CampaignId;
                ci.ContactId=l.convertedcontactid;
                ci.OpportunityId=l.convertedopportunityid;
                ci.ModelId='03V6F000000LIvWUAW';
                ci.Influence=100;
                i++;
                c.add(ci);
                
            }
            
            else{
                Campaigninfluence ci1 =new Campaigninfluence();
                ci1.CampaignId =ii.CampaignId;
                ci1.ContactId=l.convertedcontactid;
                ci1.OpportunityId=l.convertedopportunityid;
                ci1.ModelId='03V6F000000LIvWUAW';
                ci1.Influence=0;
                c.add(ci1);
                
            }
        }
    }
    insert c;
}
 Test Class - -
@isTest(SeeAllData=true)
public classAdd_as_Campaigninfluence_test { 
    
    public static testmethod void unitTest(){
        Lead leadObj1 = new lead(lastname = 'Rahul',company='goggle');
       Add_as_Campaigninfluence_test objC = new Add_as_Campaigninfluence_test();
        insert leadObj1;
        
        Lead get=[select company from Lead where lastname='Rahul'];
        get.LastName='testing';
        update get;
        
        database.LeadConvert lc = new database.LeadConvert();
        lc.setLeadId(leadObj1.Id);
        LeadStatus convertStatus = [Select Id, MasterLabel from LeadStatus where IsConverted=true limit 1];
        lc.setConvertedStatus(convertStatus.MasterLabel);
        
        Database.LeadConvertResult lcr = Database.convertLead(lc);
        System.assert(lcr.isSuccess());
        if(leadObj1.IsConverted){
            Campaigninfluence li =new Campaigninfluence();
            li.CampaignId = '7016F000001519d';
            li.ContactId = leadObj1.ConvertedContactId;
            li.Influence = 100;
            li.OpportunityId = leadObj1.ConvertedOpportunityId;
            li.ModelId = '03V6F000000LIvWUAW';
            insert li;
            
        }
        if(leadObj1.IsConverted){
            Campaigninfluence li =new Campaigninfluence();
            li.CampaignId = '7016F000001519d';
            li.ContactId = leadObj1.ConvertedContactId;
            li.Influence = 0;
            li.OpportunityId = leadObj1.ConvertedOpportunityId;
            li.ModelId = '03V6F000000LIvWUAW';
            insert li;
        }
        
    }
}
Any help will/would be appreciated :)

 
hello Everyone,
actually i want to automate the process of  'add to campaign member' but i am getting some error.
Here are the scenario details : 
Whenever any lead enters in the database with LeadSource = Linkedin (PicklistValue) it should automatically get added to the particular campaign which will be having a specific campaign id.
I think this secnario can handle with Trigger , Flows and Process Builder 
I have tried Everything to implement this secnario but i am getting Some errors. please help me to complete this automation.
Any help will be appreciable :)

here is the Trigger
trigger add_member_to_camp on Lead (before insert,after insert) {
   List<CampaignMember> members = new List<CampaignMember>();
    
    for(lead l : Trigger.new){
        
        if(l.LeadSource == 'linkedin'){
            CampaignMember cm = new CampaignMember(CampaignId = '70128000000Btjj');
        }
        try{
        insert members;
    } catch(DmlException e) {
        System.debug('An unexpected error has occured: ' + e.getMessage());
    }
    }

}

Flow 

User-added image

User-added image


User-added image


User-added image

User-added image


And Process builder also  showing some Error 
please help me 

Thanks 
Bharat Sharma
Hello all,

Thanks in advance,

I am trying to fetch some records in object LEAD. but i am stuck, please Help me to Out of there.

Lead object have a standerd field LastActivityDate, In some leads it is blank and some times it is filled with a specific date. so i want  Count the leads that contains value (Date) in their LastActivityDate(Field) and count too who doesn't have value of LastActivityDate(field) means (LastActivityDate = null) .i want these two record in one table.

I have already impliment that scenario, But

i have two query first one is returning null values :  
SELECT COUNT(id)  FROM Lead WHERE LastActivityDate = Null

Secoend one is returning not null values:
SELECT COUNT(id)  FROM Lead WHERE LastActivityDate != Null


Acctully i am creating dashboard in VF page thats why i need a query who calculate the LastActivityDate null and not null values and show them in a pie chart so please use  GROUP BY LastActivityDate .


Thanks and Regards
Bharat Sharma

 
Hello everyone 

I want to update event custom field in lead detail page please help me.
Ques: I have a three custom field in Event object
1- Meeting Status (API - Meeting_Status__c(picklist)) (values: Scheduled, Rescheduled, Cancelled, No Show)
2- Is Meeting Completed-( API-Is_Meeting_Completed__c(Checkbox))
3-First Meeting Scheduled-
(API - First_Meeting_Scheduled__c(Checkbox))

same as in Lead object 
I want that when any Event  create with the values of these three custom object or two custom field, lead  detail page would update them with same values.  
Crux of the matter is that i want to update Event custom field in Lead detail page.
 
See the Scenario...
 For more Details
 Please Help me And reply  ASAP.

Thanks and Regards
Bharat Sharma



 
Hello All,

I have a query regarding Apex please help me out,
I would like to show some details of event in Lead page ((Like meeting Status - Custom Field ) API name - Meeting_Status__c) 
this not the only one i want to show some Checkbox Is that possible to apex Trigger or should I use Apex Class.??
Please provide me a proper Solution or Reference.

I have Already implement this scenario please have a look.
public with sharing class Event_field_on_lead {
    
    public static String ldPrefix =  Lead.sObjectType.getDescribe().getKeyPrefix();
    
    public static void updateEvent_field_on_lead(Set<ID> leadIds){
        
        //Query all Leads and task-event child relationships//
        
        List<Lead> Leads = [SELECT Id, LastActivityDate,
                            (SELECT Id, WhoId, Meeting_Status__c, ActivityDate FROM Events )
                            
                            FROM Lead WHERE ID IN :leadIds];
        
        List<Lead> updateLeads = new List<Lead>();
        
        
        
        for (Lead l : Leads) {
            
            
            
            Integer count =  l.Events.size();
            
            
            
            if (count != 0) {
                
                
                for (Event e : l.Events){
                    
                    if (l.LastActivityDate <= e.ActivityDate) {
                        
                        l.Meeting__c = e.Meeting_Status__c;
                        
                    }
                    
                }
                
                
            } 
            
            
            updateLeads.add(l);
            
        }
        
        
        
        
        
        if(updateLeads.size()>0) {
            
            try{
                
                update updateLeads;
                
            }
            
            catch (Exception e) {
                
            }
            
        }
    }
}

 
Hello all, 
Question: i want to create a custom field in lead object the lable would be Activity count (Number type & API Name: Activity_count__c).
(firstly i am dealing with the task only)For a Specific lead  Whenever task created with subject ='call' the count would be increase 0 or null to 1. if the subject is other then 'Call' the Activity count field Will remain same and it will not increase after the Activity count= 1 it will increase only once. Example= When Activity count= 1 and task created the  Activity count would be remain same as before.


Ans: I have Already implement this scenario. my trigger is working ( not working when the value of Activity count=null) . StilI have issue:
Why it is not working for null value that i have Discussed before?
The code coverage is still 35% after the creating test class I want atleast 75% 

​Trigger-
 
​trigger TaskUpdateLead on task (after delete, after insert,  after update) {
    
    Set<ID> LeadIds = new Set<ID>();
    String leadPrefix = Lead.SObjectType.getDescribe().getKeyPrefix();
    if(trigger.new!=null){
        for (Task t : Trigger.new) {
            if (t.WhoId!= null && string.valueof(t.WhoId).startsWith(leadPrefix) ) {
                if(!LeadIds.contains(t.WhoId)){
                    LeadIds.add(t.WhoId);
                }
            }
        }
    }
    
    if(trigger.old!=null){
        for (Task t2 : Trigger.old) {
            if (t2.WhoId!= null && string.valueof(t2.WhoId).startsWith(leadPrefix) )
            {
                if(!LeadIds.contains(t2.WhoId)){
                    LeadIds.add(t2.WhoId);
                }
            }
        }
    }
    if (LeadIds.size() > 0){
        List<Lead> leadsWithTasks = [select id,Activity_Count__c,(select id from Tasks where  Subject = 'Call'     LIMIT 1 ) from Lead where Id IN : Leadids   ];
        List<Lead> leadsUpdatable = new List<Lead>();
        for(Lead L : leadsWithTasks){
            L.Activity_Count__c = L.Tasks.size();
            leadsUpdatable.add(L);
        }
        if(leadsUpdatable.size()>0){
            
            update leadsUpdatable;
            
        }
        
    }
}



Test Class-
 
@istest
/** Test when subject is call**/
public Class TaskupdateLead
{
    Private static testMethod void TaskinsertLead()
    {
        Task t1 = new Task();
        t1.OwnerId = UserInfo.getUserId();
        t1.Subject = 'Call';
        t1.Status = 'Not Started';
        t1.Priority = 'Normal';
        insert t1;
    }
    private static testMethod void taskwidemail()
    {
        Task t2 = new Task();
        t2.OwnerId = UserInfo.getUserId();
        t2.Subject = 'Email';
        t2.Status = 'completed';
        t2.Priority = 'Normal';
        insert t2;
    } 
}
Hope some one will help me

Thanks And Regards
Bharat Sharma
 
Hello, I am working on lightning component and stuck on scenario is there any way to switch one lightning component to another component when both are in different lightning pages.  
Please Help Me.
Thanks In Advance. :)
Hi Friends,

I am creating a application for restaurent purpose. 
I want to genearte single bill for multiple orders of a single customer . Is it possible ? And how it is Possible.

Thanks in Advance.

Hi All,
I am trying to create a new Account field, Top_Pain_Points__c, that takes the same text value as a field, Top_Pain_Points__c on a custom object, Hands_Off_Form__c. The custom object is tied to a certain Opportunity and the value should copy over from the Custom Object to Account when the Opportunity is moved to closed won. 

I have created a workflow rule to perform this task, the rule is Opportunity Closed Won EQUALS True. 

The evaluation criteria is: Evaluate the rule when a record is created, and any time it's edited to subsequently meet criteria

The field update updates Account: Top Pain Points ( Data Type: Text Area )

The formula is: Formula Value (Text) = Top_Pain_Point__c 

I have done a few workflow rules before so I thought that I was doing everything right, but can someone see any flaws in my logic or have a better suggestion of how to go about this?

Thanks!

Garrett

Hello guys im new to apex triggers.
I have 2 objects, standard (Contract) and costum (soccerplayers__c).
I want to create a trigger that updates Contracts start date in soccerplayers__c based on the value i puted in Contracts.
I am trying to compare the different contracts based on the players name, i have a lookup between the two objects.
The Name field on contract is (player_represented_by__c) and on soccerplayers__c is (Name). Ps: this is the name of the lookup fields.
If i didn´t express myself right you can ask me, i will try to answer.

 
It has been a long time I am facing an issue in my lightening component. 
I am building a lightning component and I am facing some issue please help me to getting out of there.
Exact Scenario is that I have created a calendar that is lightening component in which I have use a normal JavaScript in HELPER.js for creating a dynamic HTML element.
And it is working fine. when I am applying this component to detail page of Lead object layout, it is getting load first time correctly but when I am switch lead from lead tabs (to another Record) it requires a manual reload.
 
Please refer the image for more details. Please help me.

Image 1image 2image 3


Thank you in Advance.
 
hello Everyone,
actually i want to automate the process of  'add to campaign member' but i am getting some error.
Here are the scenario details : 
Whenever any lead enters in the database with LeadSource = Linkedin (PicklistValue) it should automatically get added to the particular campaign which will be having a specific campaign id.
I think this secnario can handle with Trigger , Flows and Process Builder 
I have tried Everything to implement this secnario but i am getting Some errors. please help me to complete this automation.
Any help will be appreciable :)

here is the Trigger
trigger add_member_to_camp on Lead (before insert,after insert) {
   List<CampaignMember> members = new List<CampaignMember>();
    
    for(lead l : Trigger.new){
        
        if(l.LeadSource == 'linkedin'){
            CampaignMember cm = new CampaignMember(CampaignId = '70128000000Btjj');
        }
        try{
        insert members;
    } catch(DmlException e) {
        System.debug('An unexpected error has occured: ' + e.getMessage());
    }
    }

}

Flow 

User-added image

User-added image


User-added image


User-added image

User-added image


And Process builder also  showing some Error 
please help me 

Thanks 
Bharat Sharma
Hello everyone 

I want to update event custom field in lead detail page please help me.
Ques: I have a three custom field in Event object
1- Meeting Status (API - Meeting_Status__c(picklist)) (values: Scheduled, Rescheduled, Cancelled, No Show)
2- Is Meeting Completed-( API-Is_Meeting_Completed__c(Checkbox))
3-First Meeting Scheduled-
(API - First_Meeting_Scheduled__c(Checkbox))

same as in Lead object 
I want that when any Event  create with the values of these three custom object or two custom field, lead  detail page would update them with same values.  
Crux of the matter is that i want to update Event custom field in Lead detail page.
 
See the Scenario...
 For more Details
 Please Help me And reply  ASAP.

Thanks and Regards
Bharat Sharma



 
Hello All,

I have a query regarding Apex please help me out,
I would like to show some details of event in Lead page ((Like meeting Status - Custom Field ) API name - Meeting_Status__c) 
this not the only one i want to show some Checkbox Is that possible to apex Trigger or should I use Apex Class.??
Please provide me a proper Solution or Reference.

I have Already implement this scenario please have a look.
public with sharing class Event_field_on_lead {
    
    public static String ldPrefix =  Lead.sObjectType.getDescribe().getKeyPrefix();
    
    public static void updateEvent_field_on_lead(Set<ID> leadIds){
        
        //Query all Leads and task-event child relationships//
        
        List<Lead> Leads = [SELECT Id, LastActivityDate,
                            (SELECT Id, WhoId, Meeting_Status__c, ActivityDate FROM Events )
                            
                            FROM Lead WHERE ID IN :leadIds];
        
        List<Lead> updateLeads = new List<Lead>();
        
        
        
        for (Lead l : Leads) {
            
            
            
            Integer count =  l.Events.size();
            
            
            
            if (count != 0) {
                
                
                for (Event e : l.Events){
                    
                    if (l.LastActivityDate <= e.ActivityDate) {
                        
                        l.Meeting__c = e.Meeting_Status__c;
                        
                    }
                    
                }
                
                
            } 
            
            
            updateLeads.add(l);
            
        }
        
        
        
        
        
        if(updateLeads.size()>0) {
            
            try{
                
                update updateLeads;
                
            }
            
            catch (Exception e) {
                
            }
            
        }
    }
}

 
Hello all, 
Question: i want to create a custom field in lead object the lable would be Activity count (Number type & API Name: Activity_count__c).
(firstly i am dealing with the task only)For a Specific lead  Whenever task created with subject ='call' the count would be increase 0 or null to 1. if the subject is other then 'Call' the Activity count field Will remain same and it will not increase after the Activity count= 1 it will increase only once. Example= When Activity count= 1 and task created the  Activity count would be remain same as before.


Ans: I have Already implement this scenario. my trigger is working ( not working when the value of Activity count=null) . StilI have issue:
Why it is not working for null value that i have Discussed before?
The code coverage is still 35% after the creating test class I want atleast 75% 

​Trigger-
 
​trigger TaskUpdateLead on task (after delete, after insert,  after update) {
    
    Set<ID> LeadIds = new Set<ID>();
    String leadPrefix = Lead.SObjectType.getDescribe().getKeyPrefix();
    if(trigger.new!=null){
        for (Task t : Trigger.new) {
            if (t.WhoId!= null && string.valueof(t.WhoId).startsWith(leadPrefix) ) {
                if(!LeadIds.contains(t.WhoId)){
                    LeadIds.add(t.WhoId);
                }
            }
        }
    }
    
    if(trigger.old!=null){
        for (Task t2 : Trigger.old) {
            if (t2.WhoId!= null && string.valueof(t2.WhoId).startsWith(leadPrefix) )
            {
                if(!LeadIds.contains(t2.WhoId)){
                    LeadIds.add(t2.WhoId);
                }
            }
        }
    }
    if (LeadIds.size() > 0){
        List<Lead> leadsWithTasks = [select id,Activity_Count__c,(select id from Tasks where  Subject = 'Call'     LIMIT 1 ) from Lead where Id IN : Leadids   ];
        List<Lead> leadsUpdatable = new List<Lead>();
        for(Lead L : leadsWithTasks){
            L.Activity_Count__c = L.Tasks.size();
            leadsUpdatable.add(L);
        }
        if(leadsUpdatable.size()>0){
            
            update leadsUpdatable;
            
        }
        
    }
}



Test Class-
 
@istest
/** Test when subject is call**/
public Class TaskupdateLead
{
    Private static testMethod void TaskinsertLead()
    {
        Task t1 = new Task();
        t1.OwnerId = UserInfo.getUserId();
        t1.Subject = 'Call';
        t1.Status = 'Not Started';
        t1.Priority = 'Normal';
        insert t1;
    }
    private static testMethod void taskwidemail()
    {
        Task t2 = new Task();
        t2.OwnerId = UserInfo.getUserId();
        t2.Subject = 'Email';
        t2.Status = 'completed';
        t2.Priority = 'Normal';
        insert t2;
    } 
}
Hope some one will help me

Thanks And Regards
Bharat Sharma
 
Hello All!

I am trying to find a way when a task is marked as "complete", that the lead status is automatically updated to "L3 - In Dialogue". Any ideas??


Thanks!  

Hello everyone,

 

we have developed a small customer search in salesforce. If you click on the "search" button manually, everything is working fine, but by clicking on the enter key, nothing happens.

 

I know that problems like this are discussed here quite often, but I didn't find a solution for my problem.

 

 

<apex:page controller="SearchFirstController" tabStyle="Search_Create__tab">
    <apex:sectionHeader title="{!$Label.sfTitle}" subtitle="{!$Label.sfSubTitle}" description="{!$Label.sfTitleDescription}"/>
    <apex:outputPanel id="errorPanel">
        <apex:pageMessage strength="2" title="{!errorTitle}" summary="{!errorMessage}" severity="{!errorSeverity}" rendered="{!errorShow}" />
    </apex:outputPanel>
    <apex:outputPanel id="searchPanel" styleClass="searchFilterFields">
    <apex:form id="searchForm">
    <div class="searchFilterFieldsHolder">
        <table class="searchFilterFields" width="100%">
        <tr>
            <td width="250px">
            <table width="100%">
            <tr>
                <td>
                    <apex:outputLabel value="{!$Label.sfFirstName}" for="searchFirstName"/>
                </td>
                <td width="100%">
                    <apex:inputText value="{!searchFirstName}" id="searchFirstName" required="false"/>
                </td>
            </tr>
            <tr>
                <td>
                    <apex:outputLabel value="{!$Label.sfLastName}" for="searchLastName"/>
                </td>
                <td width="100%">
                    <apex:inputText value="{!searchLastname}" id="searchLastName" required="false"/>
                </td>
            </tr>
            <tr>
                <td>
                    <apex:outputLabel value="{!$Label.sfAccount}" for="searchCompany"/>
                </td>
                <td width="100%">
                    <apex:inputText value="{!searchCompany}" id="searchCompany" required="false"/>
                </td>
            </tr>
            <tr>
                <td>
                    <apex:outputLabel value="{!$Label.sfPhone}" for="searchdPhone"/>
                </td>
                <td width="100%">
                    <apex:inputText value="{!searchPhone}" id="searchPhone" required="false"/>
                </td>
            </tr>
            <tr>
                <td>
                    <apex:outputLabel value="{!$Label.sfEmail}" for="searchEmail"/>
                </td>
                <td width="100%">
                    <apex:inputText value="{!searchEmail}" id="searchEmail" required="false"/>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td width="100%">
                    <apex:commandButton value="{!$Label.btnSearch}" action="{!search}" rerender="resultPanel,errorPanel" styleClass="searchFilterButton" status="processingStatus"/>&nbsp;<apex:commandButton value="{!$Label.btnReset}" action="{!reset}" rerender="searchPanel,resultPanel,errorPanel" styleClass="searchFilterButton"/>
                </td>
            </tr>
        </table>
        </td>
        <td align="center" valign="middle"><table style="font-size:80%;"><tr><td width="20%" align="right"><strong>{!$Label.sfAsterik}</strong></td><td width="80%">{!$Label.sfAsterikText}</td></tr><tr><td width="20%" align="right"><strong>{!$Label.sfQuestionmark}</strong></td><td width="80%">{!$Label.sfQuestionmarkText}</td></tr></table></td></tr></table>
    </div>
    </apex:form>
    <center><apex:actionStatus id="processingStatus" startText="{!$Label.sfProcessRequest}"/></center>
    </apex:outputPanel>
    <br/>
    <apex:outputPanel id="resultPanel">
        <apex:form id="resultForm">
        <apex:pageBlock id="leadresultPanel" title="{!$Label.sfLeads}{!If(numLeads > 0,' [' & text(numLeads) & ']',' [0]')}" tabStyle="Lead">
            <apex:pageMessage strength="2" severity="info" summary="{!$Label.sfNoLeadResultWarning}" rendered="{!noLeadResult}" />
            <apex:pageBlockSection title="{!$Label.sfMatchingLeads}" collapsible="true" columns="1" rendered="{!NOT(emptyLeadList)}">
                <apex:pageBlockTable value="{!resultListLeads}" var="leadItem">
                    <apex:column >
                        <apex:facet name="header">{!$Label.sfLeadName}</apex:facet>
                        <apex:outputLink value="{!URLFOR($Action.Lead.View, leadItem.Id)}">{!leadItem.Firstname}&nbsp;{!leadItem.Lastname}</apex:outputLink>
                    </apex:column>
                    <apex:column >
                        <apex:facet name="header">{!$Label.sfLeadCompany}</apex:facet>
                        <apex:outputLink value="{!URLFOR($Action.Lead.View, leadItem.Id)}">{!leadItem.Company}</apex:outputLink>
                    </apex:column>
                    <apex:column value="{!leadItem.Phone}"/>
                    <apex:column value="{!leadItem.Email}"/>
                    <apex:column value="{!leadItem.Status}"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
            <apex:commandButton id="createNewLead" value="{!$Label.btnNew}" action="{!createNewLead}"/>
        </apex:pageBlock>
        <apex:pageBlock id="contactresultPanel" title="{!$Label.sfContacts}{!If(numContacts > 0,' [' & text(numContacts) & ']',' [0]')}" tabStyle="Contact">
            <apex:pageMessage strength="2" severity="info" summary="{!$Label.sfNoContactResultWarning}" rendered="{!noContactResult}" />
            <apex:pageBlockSection title="{!$Label.sfMatchingContacts}" collapsible="true" columns="1" rendered="{!NOT(emptyContactList)}">
                <apex:pageBlockTable value="{!resultListContacts}" var="contactItem">
                    <apex:column >
                        <apex:facet name="header">{!$Label.sfContactName}</apex:facet>
                        <apex:outputLink value="{!URLFOR($Action.Contact.View, contactItem.Id)}">{!contactItem.Firstname}&nbsp;{!contactItem.Lastname}</apex:outputLink>
                    </apex:column>
<!--                    <apex:column value="{!contactItem.Company}"/>-->
                    <apex:column value="{!contactItem.Phone}"/>
                    <apex:column value="{!contactItem.Email}"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
            <apex:commandButton id="createNewLead" value="{!$Label.btnNew}" action="{!createNewContact}"/>
        </apex:pageBlock>
        <apex:pageBlock id="accountresultPanel" title="{!$Label.sfAccounts}{!If(numAccounts > 0,' [' & text(numAccounts) & ']',' [0]')}" tabStyle="Account">
            <apex:pageMessage strength="2" severity="info" summary="{!$Label.sfNoAccountResultWarning}" rendered="{!noAccountResult}" />
            <apex:pageBlockSection title="{!$Label.sfMatchingAccounts}" collapsible="true" columns="1" rendered="{!NOT(emptyAccountList)}">
                <apex:pageBlockTable value="{!resultListAccounts}" var="accountItem">
                    <apex:column >
                        <apex:facet name="header">{!$Label.sfAccountName}</apex:facet>
                        <apex:outputLink value="{!URLFOR($Action.Account.View, accountItem.Id)}">{!accountItem.Name}</apex:outputLink>
                    </apex:column>
                    <apex:column value="{!accountItem.Phone}"/>
                    <apex:column value="{!accountItem.Type}"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
            <apex:commandButton id="createNewAccount" value="{!$Label.btnNew}" action="{!createNewAccount}"/>
        </apex:pageBlock>
        </apex:form>
    </apex:outputPanel>
</apex:page>

 

 

Thanks and regards

Markus

  • August 16, 2010
  • Like
  • 1

Trailhead is bugging out on accepting my completed challenge (I think). 

The task is: "In '3 - Sales & Marketing Adoption' dashboard, change the dashboard component for 'New LEAD Trend by Source' to a pie chart and set the wedges to Lead Source"

As you can see by the attached picture - I have completed the steps.

The picture may be hard to see- but wedges are set to lead source. I keep getting an error message that it is not. Bug fix?