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
sfdc_1sfdc_1 

i have one scenario in salesforce please let me know what to do in this case

i have one scenario in salesforce please let me know what to do in this case.

i have page(custom object) have lookups to relate to both Account and Opportunity. 
When records created at Opportunity level, page do not rollup to Account 
Need to populate Account lookup with related Account when page records are created on Opportunities 
Danish HodaDanish Hoda
Hi there,
Please elaborate, I couldn't get your requirements properly.
sfdc_1sfdc_1
Hi Danish, 

​​​​​My requirement is I have one custome object call page and it has lookup realtionship with both account and opportunities 
So in opportunity if I am create any record related to page object which have lookup relationship with both account and opportunities. Whenever we are creating any record of page object in opportunity it should reflect in account also how many records are there in opportunity for that particular page object 
Danish HodaDanish Hoda
hi there,
Since you have lookup relationship with page and Account, and you want the number of records to be reflected on Account record, you need to write logic in trigger.
Since roll-up summary fileds are only available for Master-detail relationships, only exception is the Account-Opportunity lookup relationsip (cascade relationsship).