-
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
Discover Innovative Solutions for Salesforce Experience Cloud at Dreamforce 2022
Salesforce has been nothing short of revolutionary, since its inception. As the world’s #1 CRM platform, it has connected organizations across the globe with their…
Empower Your Mission: A Guide to Salesforce for Nonprofits
Nonprofit organizations face a unique set of challenges. From managing donors and volunteers to driving fundraising campaigns and ensuring transparency, efficiency is critical. In today’s…
Popular Salesforce Videos
Salesforce - What is customer service?
Believe it or not, your customers’ needs are also your business’s needs. Great customer service ensures customers are so happy, they’ll come back for more…
2020 Salesforce Admin Certification - OWD - Record Level Security
Learning Objectives After completing this unit, you’ll be able to: Describe the difference between an object and field-level security Describe how to set org-wide default…
Salesforce Pardot Basics - A Comprehensive Guide (2021)
In this short video, we will cover the basics of Salesforce Pardot Pardot by Salesforce is a demand generation and marketing management tool by Salesforce.…
Popular Salesforce Infographics
A day in the life of a Sales VP using the CRM from Salesforce
The devil is in the details. Before making a decision on the adoption of a new solution, it is important to be able to move…
6 Tips to Evaluate the Right Salesforce QA Vendor
Salesforce is the ultimate customer success platform, which makes it important to choose the right partner for your Salesforce project especially because it governs your…
Salesforce and QuickBooks Integration - Transform your Business
Do you know that you can convert 30% of your opportunities into leads when you integrate Salesforce and QuickBooks together? Sounds Interesting right? Our connector eShopSync…