-
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

Comparing Salesforce Lightning With Salesforce Classic
The executive's customer relationship is very important to the collaboration with the association's present and future clients, especially in the current scenario, which is full…

Transaction Security in Salesforce
Introduction Transaction Security is a security feature that observes the activity in your Salesforce org in real-time to catch the potential security issue based on…

A Complete Guide to Dreamforce 2024
Dreamforce, Salesforce’s flagship conference, is the highlight of the year for many professionals in the Salesforce ecosystem. With countless workshops, networking opportunities, and parties –…
Popular Salesforce Videos
What are Salesforce Developer Edition?
Salesforce Developer Account is actually a free of cost account. If you wanted to explore and if you wanted to do the configuration practices or…
Lightning Component Development - Applying Stylesheet, Create Basic Lightning Component
Welcome to Lightning Component Development Sessions. This is the initiative to help Salesforce Community in learning Lightning which we believe is future of Salesforce. Check…
Salesforce Business Analyst Training
In the 35th Episode of the #AskTheHulk series, Savitha Asked about how to switch to IT from Non-IT background. To this question, Shrey suggested that…
Popular Salesforce Infographics

5 Advantages of Using The Salesforce Data Migration Tool in Your Organization
Advantages Of Using The Salesforce CRM Data Migration Services In Your Company are: Fast migration process Repetitive deployment Suitable for both novice and advanced Salesforce…

Salesforce Administrator Salaries – Around The World
A Salesforce administrator; the gatekeeper to an organisation’s Salesforce capabilities. With the huge acceleration of data in our lives, it’s no surprise that job roles…

How to Hire Hire Salesforce Cloud Consultants For Business Growth
Need Trusted Salesforce Cloud Experts For Business Transformation? Hire certified cloud experts from Concretio to unleash the power of Salesforce cloud & leverage its potential…