-
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
How Salesforce Financial Services Cloud Solves Problems For FinTech Companies
Working in the financial services industry is not an easy-breezy thing to do. It is all about managing people’s wealth and helping them plan their lives, literally.…
Nine Common Pain Points Solved by Salesforce Revenue Cloud
Revenue, and especially revenue that is trending upwards, is a clear indicator of an organization’s health and potential. However, responding to fluid market shifts and…
Top 10 Salesforce Consulting Companies in 2024
Building stronger customer relationships is the need of the hour in this technology-driven world. Salesforce, being the #1 CRM platform, helps your business accomplish this goal.…
Popular Salesforce Videos
How to Establish a Many to Many Relationship in Salesforce?
You can use master-detail relationships to model many-to-many relationships between any two objects. A many-to-many relationship allows each record of one object to be linked…
How to Track UTMs from Pardot Through to Salesforce Campaigns
UTM parameters can be used to track the traffic from a variety of sources including email, social media, banner ads, and more. But how can…
How Big Was Salesforce Dreamforce 21 Park? Take a Walk.
This two-minute walk shows exactly how Salesforce Dreamforce 21 International Park was set up. See for yourself how big it is. Also, share your Dreamforce…
Popular Salesforce Infographics
Top Salesforce Trends For 2023
When it comes to managing customer databases, Salesforce is leading the pack. Companies are increasingly relying on this powerful tool for its unrivalled flexibility and…
Salesforce Einstein Features Across The Clouds
The infographic shows how Salesforce Einstein will be affecting each individual cloud.
The Role of a Salesforce Administrator
Identify the latest Salesforce Administrator trends from the Salesforce Usage Report 2017 using data from over 1,200 Salesforce respondents. Publisher : Ebsta Limited