-
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
Empower Your Business with Expert Power BI Developers and Consultants
In today's data-driven world, organizations need actionable insights to make informed decisions. Hiring a skilled Power BI developer or Power BI consultant can unlock the…
An Introduction to Salesforce Wave Analytics
Analytics is secure, trustable, scaled and also it is responsive to access on every media screen. It can be easily used in org to handle…
Single or Multi-Org - What is your Salesforce Architecture?
While setting up a Salesforce Architecture or assessing the performance of an existing org, the most perplexing question that haunts anyone is to decide between…
Popular Salesforce Videos
How Cyntexa Helped Suppliers Of Electronics To Create Their Online Presence? | Salesforce Solutions
Creating an online presence has become one of the most in-demand ways to grow a business. Presenting you a case study showcasing how Cyntexa helped…
Practice Test and Questions for Salesforce Platform App Builder Certification Exam
In this video, Shrey provides a practice test for the candidates who are preparing for the Salesforce Platform App Builder Exam. This test boosts your…
Creating an Approval Process in Salesforce with Example
Approval Process in Salesforce is an automated process that automates how Salesforce records are approved in your org. Approval Process in Salesforce is a combination…
Popular Salesforce Infographics
Significance of Pardot Integration with Salesforce
What is Pardot? Listed as one of the most impeccable tools for B2B marketing, Pardot helps businesses to reach prospects through paid marketing, email campaigns,…
5 Roadblocks That Undermine Innovation — and How to Avoid Them
Here is an infographic of the five stumbling blocks that can get in your team’s way, along with tips to minimize their business disruption and…
Build On Your Salesforce Service Cloud With Cognitive Search
Employees waste around 20% of their time looking for information to do their job. That’s a lot, isn’t it? This means there is one giant…