-
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 Lightning customization - Related List Quick Links
Related List Quick Links- We are familiar with looking at any record in salesforce lightning. If you want to see all the related list record then you…
What is Salesforce CPQ (Configure Price Quote) - All You Need To Know
A brief introduction to Salesforce CPQ CPQ Salesforce, or Configure, Price, Quote Software by Salesforce is a business apparatus for organizations to furnish precise evaluation…
Keys to Improve Salesforce DevOps Efficiency
As indicated by the State of Modern Applications in Enterprises Report 2020, just 37% of big business respondents are happy with how quickly they are…
Popular Salesforce Videos
Salesforce CRM Full Training Tutorial For Beginners
In this video, Nick Boardman explains how to use the key features inside Salesforce CRM. He explains various dashboard options, setting up campaigns etc.
Salesforce Grid Component Modernization with Webix Widgets
Take a break and watch a short video about how we modernized the Salesforce Grid component with Webix.
How to Write Your First Apex Program? | Salesforce Tutorial
Apex is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on the Lightning platform server in conjunction…
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…
Take a look at the future of CPQ with this infographic!
Business-to-business sales, often referred to as simply B2B, used to be much less complex. But now, there is a lot that goes into these quotes…
How to Use Psychology to Target Your Buyer?
Ever wanted to get into the minds of your customers and figure out how they think? Ever wanted to know the best methods to convince…