You need to sign in to do that
Don't have an account?
Show Event Details in Lead Page.
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.
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) { } } } }
This can be achieved through trigger please refer below sample code.
Please refer below link for the same.
http://salesforce.stackexchange.com/questions/16743/determine-activity-type-completed-on-lead-object
Hope this helps you!
Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution.
Thanks and Regards
Sandhya
and Sorry sandhya it is not working, there is some error like
Variable does not exist:t.ActivityDate
Variable does not exist: latestActivity
Please assist me ..
Thanks And Regards
Bharat Sharma