-
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 Managed vs. Professional Services: Which One is Right for Your Business?
Salesforce provides a range of services to help organizations optimize their CRM capabilities. When it comes to leveraging the power of Salesforce, organizations often navigate…
How Salesforce Customization Services Can Help Your Business
Salesforce is known to have thousands of features used by businesses, along with customization options. Off-the-shelf Salesforce solutions might initially help a business but, moving…
Popular Salesforce Videos
Get a Complete View of Salesforce Data with MongoDB
Teri will show you how you can incorporate Salesforce (relational data) into a MongoDB collection (non-relational data) to give your customers a unified customer experience.…
How to Become a Salesforce Developer? No Programming Experience Needed
Salesforce Developer has once again been named one of the world's best jobs. In a list of 25 job roles, Salesforce was the only company…
How to Transform Sales Processes with Salesforce Anywhere
Salesforce Anywhere – a real-time interface that extends the power of Salesforce – is here to give sales leaders more visibility into what’s going on…
Popular Salesforce Infographics
Boost Efficiency with Salesforce Workflow Automation
Is your sales team bogged down by busywork? Let workflow automation be your hero!Give your team the gift of time!
Top-notch Salesforce Development Services and Consulting
Our top-notch Salesforce development services. As a Salesforce Development Services partner, we have access to a wide range of resources and support from Salesforce, including training,…
Salesforce Admin Certification Path
This infographic helps you to understand the complete certification path to become Salesforce Administrator which includes accreditation body, pre-requisites, eligibility criteria, examination format and career…