-
Salesforce batch class to update unrealed object field with rollup summary field.
Need help to develop logic for batch class for below scenario.
I have one custom object Invoice and another object Invoice details which have master detail relation with Invoice. In Invoice there is one Rollup summary field Total Value with amount field of the Invoice Details. In Invoice object there is another field blanket number. Note : One blanket number against the multiple Invoices. i,e blanket number 123 --- invoice 1 blanket number 123 --- invoice 2 blanket number 123 --- invoice 3
Have another custom object Invoice details and there in one text field blanket number which can be filled manually by sales person and another field Total amount which would be populated by trigger. i,e if sales person enter blanket number 123 then total amount would be addition of invoice 1, invoice 2 and invoice 3 total value(addition of rollup summary field) above logic should be implemented by trigger and working fine.
Now the requirement is if new invoice with invoice item will come(by interface) with the same blanket number then Total amount field of Invoice details should be updated with addition of new rollup summary field value (old value + new rollup summary field value). i,e if old value id 1000 and new invoice rollup summary field value is 500 then Total amount field of Invoice details should be 1500.
Hope this requirement is clear. I appreciate any help to write batch class for these.
Thank you in advance.
Log In to reply.
Popular Salesforce Blogs
Benefits of Hiring a Salesforce Managed Services Provider
Salesforce is among one of the most powerful and versatile business tools currently available. It can help businesses of all sizes streamline their processes and…
Become an Advanced Salesforce Administrator [Exam Notes]
Have you ever doubted your skills of becoming an Advanced Salesforce Administrator? Most of us would have walked down that road, I’m sure. Whilst, some…
Fastest "For Loop" in Salesforce
Loops play a very important part in our Lives. Whenever we need to play over large sets of Data, we usually use For Loops. But…
Popular Salesforce Videos
GS DevOps Mate: Your Free Flexible Toolkit for Faster & Smoother Salesforce Deployments
Our webinar about GS DevOps Mate: A free, open-source, CI/CD platform agnostic toolkit! Our host is Rohan Gore a Technical Architect here at Groundswell who…
4 Benefits of Salesforce Vlocity Communications Clouds
Vlocity Communications effortlessly collaborate with Salesforce Service Cloud to design a solution to garner personalized and uninterrupted experience for customers throughout their channels. This not…
Permissions In Salesforce Experience Cloud Explained | Salesforce Communities
A permission set is a collection of settings and permissions that give users access to various tools and functions. Permission sets extend users' functional access…
Popular Salesforce Infographics
Why Salesforce For Your Business?
Why Choose Salesforce? According to Salesforce, companies show the following trends as a result of Salesforce Implementation. 25% Increase in Revenue 35% Increase in Customer…
Impact of Salesforce
Salesforce is no doubt is one of the boldest CRM on the cloud in the world. This infographic helps you scan through all the vital…
The key takeaways from Salesforce Basecamp 2017
Thousands of Trailblazers have converged on Hong Kong, Auckland, Singapore, Mumbai and Melbourne. They heard from a stellar line-up of industry experts, Salesforce Trailblazers and…