-
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
Top 7 Salesforce Commerce Cloud Features Every eCommerce Brand Should Use in 2025
eCommerce is no longer just about having an online store. It's about creating experiences that make customers want to come back. And in 2025, that…
Salesforce Sales Cloud vs Service Cloud
Salesforce Sales Cloud and Service Cloud are two powerful tools that can help businesses of all sizes manage their customer interactions and data more effectively.…
No Code Salesforce Strategic Integration with DocuSign
Salesforce and DocuSign recently expanded its footprint of their worldwide strategic relationship to create integrated solutions that will help clients accelerate how agreements are facilitated…
Popular Salesforce Videos
Security for Salesforce Developers: Data Security
In this series, we review the most important concepts that developers must understand to create secure applications on the Salesforce platform. We talk about data…
How to Filter and Organize Your Data | Salesforce Essentials
In this video, you will learn how list views help you group people and deals so you can find the data you need faster. Salesforce…
Salesforce Territory Management
This short video gets you started in setting up sales territories for your team. With sales territories, you can keep track of which sales reps…
Popular Salesforce Infographics
Salesforce - Key For Your Industry Solutions
Salesforce endlessly improves the productivity and performance of the company. To enhance the customer experience and generate more revenue many industries will be opting for…
How to Create a Community of Trust and Gratitude with Salesforce
The businesses that will be remembered positively after COVID-19 are extending empathy and grace to their employees, customers, and communities. We’ve seen so many communities…
CRM Administrator - Better CRM Adoption With Less Resistance | Salesforce
A CRM is only as strong as its data. It can improve efficiency and personalize the customer experience if employees are comfortable using it. By…