-
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
Test Classes In Apex Salesforce | The Developer Guide
Best Practices of Test Class in Salesforce @TestVisible - To access private member in Test Class Test.LoadData - Creating test data without code System.RunAs -…
Chrome Blocking Mixed Content in Salesforce - All You Need To Know
Substance over HTTPS is getting to be a more grounded browser necessity. Google Chrome is presenting an arrangement of notices and will start blocking blended…
Tips to Choose Reliable Salesforce Consulting Partners in 2019
Salesforce now helps enterprises to streamline various facets of a business ranging from sales to product delivery and customer support. Salesforce is so popular for…
Popular Salesforce Videos
Salesforce Anywhere: Technology Enabling the All-Digital, Work-From-Anywhere World
While companies, governments and organizations are slowly returning to their offices, the COVID-19 pandemic has changed the future of work forever. In fact, nearly 70…
See what amazing things Cauzali can add to your Salesforce solution - without code
Use Cauzali to add functionality to your Salesforce community solution. In this video, we have a focus on Salesforce Financial Service Cloud, but Cauzali works…
What is Audit Trail in Salesforce?
The Setup Audit Trail feature in Salesforce enables you to closely track changes made to your organization. It records all modifications concerning the administration, customization, security,…
Popular Salesforce Infographics
The 10.5 Commandments of Salesforce Users
This great piece of visual goodness presents the 10 commandments every Salesforce user needs to follow. Make sure every single one of these practices is…
Average Salesforce Salaries in 2023-2024: What You Need to Know
Salesforce is a popular CRM platform that is used by businesses of all sizes. If you're considering a career in Salesforce, you may be wondering…
The Timeline: 20 Years of Salesforce
Salesforce completed 20 years recently. The celebrations were grand with thousands of employees and trailblazers and Ohana family joining in. The world’s no. 1 CRM…