-
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
Artificial Intelligence in Salesforce Einstein - An Overview
To begin with artificial intelligence, it is the branch of computer science that focuses on the development of machine intelligence which makes machines work like…
NorCal Dreamin’ 2019: Salesforce Community Conference by the Salesforce Community
The Salesforce Community is back with another amazing event, NorCal Dreamin’ on June 27-28, 2019 in Sacramento, CA. It will be a Salesforce conference organized…
Driving Engagement on Salesforce Communities With Walk-Throughs
Remember visiting an online community with unfriendly navigation? How did it feel? We bet you didn’t think twice before looking for another community. To enable…
Popular Salesforce Videos
Salesforce Summer 20 Dynamic Forms
Salesforce’s Summer ’20 Release Notes have now been published, we can now dive under the hood to see what the top features are! Historically, Summer…
Everything New in Salesforce Developer Tools
Your productivity starts and ends with the tools you use. Learn how Salesforce Developer Tooling can help you collaborate more effectively with your whole team.…
Rise & Shine with The Salesforce Women's Entrepreneur Group
The Salesforce Women’s Entrepreneur Group invites you to our first quarterly event of the year, Rise & Shine - Celebrating Women’s History Month. We are…
Popular Salesforce Infographics
Buy vs. Build: Salesforce Shield: Event Monitoring
Today, businesses store their most confidential information in the cloud with applications such as Salesforce. This means dozens, hundreds, or even thousands of employees have…
Salesforce Engage : Best Practices Guide for Sales Users
Salesforce Engage is a new solution from Salesforce Pardot that unites Sales and Marketing teams to sell more effectively than ever before. With Salesforce Engage,…
5 Essential Skills for Salesforce Developers
Calling all aspiring Salesforce developers! Conquer the platform with these 5 must-have skills: ✅ Expertise ✅ Coding chops ✅ Problem-solving power ✅ Teamwork & communication…