-
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
Reports & Dashboards For Salesforce Lightning Experience
First of all the question arises why do we need Reports & Dashboards In Salesforce for business purposes.There are various reasons from which I’m going…
Salesforce IoT Cloud: Benefits and Limitations
Salesforce IoT Cloud: It provides the platform to store and process the IoT data. It enables you to combine event data from devices with existing…
Salesforce Admin Tips For A User-Friendly Org
When we talk about the term user-friendly, what comes to your mind? Obviously, something that is not difficult for the user to use? Now when…
Popular Salesforce Videos
Connect ZOOM with Salesforce | Zapier | Salesforce Tutorials
In this video, you will learn to connect the most usable business video-conferencing application the ZOOM app with Salesforce Org using ZAPIER. I will create…
How to Create a Landing Page in Salesforce Account Engagement (Pardot)?
A landing page acts as a customized doorstep for potential clients. It's crucial because it guides their focus toward a particular action, such as signing…
What is Sales Cloud in Salesforce? | How it can Help Any business?
In this video, Shrey is not only teaching but also demonstrating the concept of Sales Cloud in Salesforce. 1. What is sales cloud in Salesforce?…
Popular Salesforce Infographics
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…
Six Reasons Clients Love Salesforce Community Cloud
While there are way more than six reasons to love Salesforce Community Cloud, here are the top six reasons that keep coming up again and…
What are the Benefits of Salesforce CPQ Managed Services?
There are a few benefits of Salesforce CPQ Managed Services that can help organizations maximize their growth and profit margins. Prediction of cost - Salesforce…