function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
trigger ChildTrigger on Child__c (before insert) { for (Child__c C: Trigger.new) { C.Parent__c ='a075g000001zggR'; } }
trigger UpdateParent on childObject (before insert) { ParentObject pObj = [SELECT Id FROM ParentObject limit 1] //Bases on your condition for(childObject cObj : trigger.new) { cObj.ParentField = pObj .Id; //changes in fields } }
trigger UpdateParentFields on childObject (before insert) { list<ParentObject> parentList= [SELECT <any fields> FROM ParentObject limit 10] // Based on your condition for(ParentObject pObj : parentList) { //changes in fields } //update parentList. }
It can be updated.
You can try below code .I have hardcoded Parent field for reference.
If it helps, Please mark it as best answer.
Thanks!
Clarification needed , is it you are looking to update parent lookup field on child or you are looking to update related parent's different field.
Thanks!
We can update Parent field in before insert event . Below is example :
If you want to update any field of parent record from 'before insert' event , you can achieve it . Below is example
Mark this as best answer if this helped you.
Thanks