You need to sign in to do that
Don't have an account?

Please help me in trigger code
Hey, so there is the scenario we are treating custom object contacts as student object we have field in that subject__c which is picklist, totalmarks__c and avgmarks__c(Average marks) then further we need to create marks as related list to contact which will have field subject_name__c and marksobtain__c so for that i created marks object as lookup to contact so now what will be trigger to update the field totalmarks__c and avgmarks__c in contact
You can change the relationship from marks to student as Master Detail in that way you can create rollup fields for Average and Total Marks using configuration.
No need to trigger in that case.
Please let me know if you need more help on this.
Thanks
Anupama
Please try below code.
Thanks
Anupama