You need to sign in to do that
Don't have an account?
Neeru Nagpal 10
need to update different fields on single parent object from its different child records
Requirement Details:
I have one object say named A which have two diffrent child object say attachment & data.
Please help me here to code this requirement and how we can iterate both the lists in final loop.
Thanks
I have one object say named A which have two diffrent child object say attachment & data.
- a record is created in object A.
- Assignment records are created off the related record as CHILDREN of the A
- Each Assignment record has a Resource lookup, which holds a Contact record
- There may be up to 10 Assignment records created
- At a later point, a Data (third object) Record is created off the related record as a CHILD of the A
Please help me here to code this requirement and how we can iterate both the lists in final loop.
Thanks
I am trying to understand your requirement a little better so that I can help you out.
1. You have ObjectA (which is parent) and two children (Assignment and Data).
2. Assignment has a lookup to Contact. Assignment can have upto 10 records per record in ObjectA
3. You create one record in Data per record in ObjectA, which has 10 fields to hold Resource information.
My question is what kind of fields are these 10 fields? Are they lookup to Assignment? Or, are they lookup to Contact?
No these are simple text fields.. in which i want to just add the contact full name from assignment records.
Try this trigger. I have made assumptions on your object names and field names.
For example,
1. Objects names are ObjectA__c, Assignment__c and Data__c
2. Contact look up in Assignment__c is Resource__c
3. Resource fields in Data__c are Resource_1__c till Resource_10__c
If these names are not matching, you need to update the code accordingly.
Let me know how it goes.
Thanks for replying.
I have written code as per design provided to me. the same code.. can you please help me get the set of resources name in this code?? as i want unique resource to be updated on survey. here is my code: