-
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
Salesforce ServiceNow Integration Guide
Table of contents: About Salesforce About ServiceNow Why integrate them? Common Salesforce ServiceNow integration use cases How to choose the best integration tool? How to…
How Various Industries benefit from Salesforce CPQ?
It doesn't matter what your business is about: you sell sports equipment or have a medical institution, the key point is that you do business,…
Popular Salesforce Videos
Salesforce Training Videos For Beginners - 1 | Salesforce Administrator Training
This Salesforce Training Video will help you understand which is the easy and best tool for CRM, Branding, tabs and homepage optimization. This is an…
Salesforce Video Wall
Salesforce approached Obscura with the opportunity to create imaginative media for the 107’ long LED video wall in the lobby of their flagship San Francisco…
What's Up with What'sApp? | Explained by Salesforce
With over 2 billion users, WhatsApp is the world’s most popular messaging app. WhatsApp channels are supported by Digital Engagement for Service Cloud. You can…
Popular Salesforce Infographics
Salesforce : Anatomy of a Productive Sales Rep
We are a nation obsessed with productivity. We look for ways to "hack" our way through life, squeezing the most out of every minute we…
New Pardot Features: What was delivered in Summer ’18
New Pardot features, summer '18. Pardot has treated us to many enhancements across the core tool and related products. This infographic gives you an overview…
All the Ways Salesforce Portal for Education Can Help Logistically
The education industry is layered and has multiple logistical elements in its workflow. How would we do it if we were to improve it? The…