Instead of using a for loop to get a set of accountId you can directly just query on opportunity with the required filters [Select Id, StageName from Opportunity where AccountId In: trigger new and Isclosed = false and Account.Close_all_Opps__c = true and Probability>= 70]; And then with just one for loop on oppList we can update the value of Stage to Closed Won and update oppList
I have scenario, how to create related records in account and contact when a record created in the lead object,, here the question is to create records for two objects(asked in interview)
one suggestion bro if you are writing logic instead of explaining that logic, explain why you are writing that logic more clearly so that we understand better Thank you🙂🙂
Instead of using a for loop to get a set of accountId you can directly just query on opportunity with the required filters [Select Id, StageName from Opportunity where AccountId In: trigger new and Isclosed = false and Account.Close_all_Opps__c = true and Probability>= 70];
And then with just one for loop on oppList we can update the value of Stage to Closed Won and update oppList
Very clear
Please keep posting more scenarios.
sure thank you
I’m getting good learning from this series thanks a lot
Thank you so much Karthik
Thank you for Sharing
Thanks for watching!
Great sir
Thank you so much Ravi
I have scenario, how to create related records in account and contact when a record created in the lead object,, here the question is to create records for two objects(asked in interview)
Hi Govardhan don’t worry i will create a video on it .
one suggestion bro if you are writing logic instead of explaining that logic, explain why you are writing that logic more clearly so that we understand better
Thank you🙂🙂
Anyone provide full code here
you can access it on Salesforce geek website thanks
Great Example 🫡
Thank you so much