-
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 Nonprofit Cloud Winter‘25 Highlights
As the chill of winter draws nearer, Salesforce is turning up the heat with the Winter ‘25 release for Nonprofit Cloud! Packed with exciting features,…
System Events in Salesforce - Learn All About it Here
The Lightning framework fires system events automatically during component initialization, attribute value changes, rendering, and so on. In their HTML markup, all Components can register…
Your Salesforce Developer Is Not an AppExchange Developer, and the Gap Costs About Six Weeks
Everyone who has ever cooked a great dinner party has, at some point, been told they should open a restaurant. It is a compliment, and…
Popular Salesforce Videos
Agile in Salesforce | Agile Salesforce Implementation
Watch this video to learn about Agile Salesforce Implementation When Salesforce met Agile Agile vs Waterfall Introduction to Scrum Scrum Roles Scrum Ceremonies Q&A
Modern App Development On Salesforce - Apex Testing
In this series, you will explore Modern App Development on the Salesforce platform, including Heroku. The live hands-on sessions will take you through the journey…
Build Your First Custom App On Salesforce
Lightning App Builder makes it super simple to quickly assemble apps using just declarative drag and drop features. This video covers how to upgrade a…
Popular Salesforce Infographics
See Why Salesforce Goes All In on Pro Bono
Salesforce Pro Bono Program aims to match nonprofits and higher education institutions with Salesforce professionals to maximize their Salesforce implementation and transform their organization. Scroll…
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…
Einstein in Action – Unleash the Power of AI in Salesforce
Drowning in data but thirsty for insights? Salesforce Einstein can be your life raft. This infographic dives into the world of AI for CRM, exploring…