- Award
- Users
- Nominee
nominee is the juction object
and one more object AllResult
I want that when a record is inserted in nominee
object, the same record gets inserted in AllResult
Object as well.
For this I have written this trigger :
trigger MakeEntryInAllResult on Nominee__c (after insert)
{
All_Result__C newEntry;
for(Nominee__c newNominee:Trigger.new)
{
newEntry = new All_Result__c();
newEntry.Award_Name__c = newNominee.Award__r.Name;
newEntry.Nominee_Name__c = newNominee.Users__r.Name;
insert newEntry;
}
}
but I am getting the values of newEntry.Award_Name__c
and newEntry.Nominee_Name__c
as null.
Please help