function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MinnuSFMinnuSF 

Hi kindly advise how to achieve this functionality using apex class and vf apge

Object RelationsResult should be
 
Best Answer chosen by MinnuSF
sandeep@Salesforcesandeep@Salesforce
Hi MinnuSF, 

Here is the logic so you can try coding for this trigger. 

1. Create a lookup field on Object3__c, lookup type of Object1__c.
2. Write a trigger on object3__c (on insert and update event event) and check whatever record (of object2__c), object3__c associated with, fetch out all child records (object1__c type) of Object2__c. You may apply a generic SOQL for this and maintain a map.
3. Finally link your object3__c record with these fetched records(of object1__c type) as parent record to. 

Thanks
Sandeep Singhal
http://www.codespokes.com/

All Answers

sandeep@Salesforcesandeep@Salesforce
Hi MinnuSF, 

Here is the logic so you can try coding for this trigger. 

1. Create a lookup field on Object3__c, lookup type of Object1__c.
2. Write a trigger on object3__c (on insert and update event event) and check whatever record (of object2__c), object3__c associated with, fetch out all child records (object1__c type) of Object2__c. You may apply a generic SOQL for this and maintain a map.
3. Finally link your object3__c record with these fetched records(of object1__c type) as parent record to. 

Thanks
Sandeep Singhal
http://www.codespokes.com/
This was selected as the best answer
MinnuSFMinnuSF
Hi Sanddep im very beginnert to salesforce is it possible to send complete syntax  it is very helpfull to me can you plese help on this 
sandeep@Salesforcesandeep@Salesforce
Sure but it may take some time. will get back to you.
MinnuSFMinnuSF
Thanq bro thank you so much