You need to sign in to do that
Don't have an account?
Devendra Hirulkar 3
Variable does not exist: Student__c.class__r
Hi all
Variable does not exist: Student__c.class__r
this error has occur in my trigger please tell me what is problem
here is my trigger
trigger copyying on class__c (after insert)
{
List<Student__c> parentObjList = new List<Student__c>();
List<Id> listIds = new List<Id>();
for (class__c childObj : Trigger.new)
{
listIds.add(childObj.Student__c);
}
parentObjList = [SELECT id,Name,(SELECT ID, Roll_No__c FROM class__r) FROM Student__c WHERE ID IN :listIds];
for (Student__c opp : parentObjList)
{
for (class__c quote: Student__c.class__r)
{
opp.Roll_No__c = quote.Roll_No__c;
}
update parentObjectList;
}
}
thanks
Deoo
Variable does not exist: Student__c.class__r
this error has occur in my trigger please tell me what is problem
here is my trigger
trigger copyying on class__c (after insert)
{
List<Student__c> parentObjList = new List<Student__c>();
List<Id> listIds = new List<Id>();
for (class__c childObj : Trigger.new)
{
listIds.add(childObj.Student__c);
}
parentObjList = [SELECT id,Name,(SELECT ID, Roll_No__c FROM class__r) FROM Student__c WHERE ID IN :listIds];
for (Student__c opp : parentObjList)
{
for (class__c quote: Student__c.class__r)
{
opp.Roll_No__c = quote.Roll_No__c;
}
update parentObjectList;
}
}
thanks
Deoo
Instead of
Use this