You need to sign in to do that
Don't have an account?
Irish@acc
Grand Parent to grand child field population
hi I have a requiremnt like this
whenevr a grand child is created(Created through trigger on parent obj) populate a user field (say Dev_Lead__c) from grand Parent object field( Dev_Lead_User__c)...and whenevr this field updated (Dev_Lead_User__c) of rand parent then again update this field on grand child object...
please help me on this trigger
You've already posted this request earlier on today. Please don't make duplicate posts - it doesn't increase the chances of a response.
Hi All,
this is my trigger which m using to create a child object on some condition...I need one field to be populated from grand parent i.e from parent of this object..plz help me on this on how to populate the field
trigger createRootCause on Task__c(after update) {
List<project__c> prj=new List<project__c>();
Set<id> GpIds=new set<id>();
for(Task__c tsk:trigger.new){
GpIds.add(tsk.Project__c);
}
List<Task__c> newtask=new List<Task__c>();
newtask=[select project__c,Project__r.Dev_Lead_User__c from Task__c where project__c=:Ids];
List<Root_Cause__c> lstRC = new List<Root_Cause__c>();//Child obj
List<task__c> lsttask = new List<Task__c>();//Parent Object
for(Task__c t:Trigger.new)
{
if(trigger.newmap.get(t.Id).Key_TQL_Milestone__c==True && trigger.newmap.get(t.Id).TQL_Phase__c=='6. Launch')
{
Root_Cause__c RCDel= new Root_Cause__c();
System.debug('Im Inside 123----->'+t);
RCDel.TaskName__c=t.Id;
RCDel.Dev_Lead__c = devLeadIds.Id; //this field need to populate from GranadParent
lsttask.add(t);
}
}
if(lsttask.size()>0){ updateClass.insertRootCause(lsttask);
}
}