-
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

Top 7 Salesforce Sales Dashboards for 2022-2023
Salesforce Sales dashboards are great tools for taking full advantage of CRM capabilities. The platform allows you to collect all the information about your company,…

Salesforce Workflow Vs Process Builder in Salesforce
Workflow Rule By using Workflows we can: 1) Update a field 2) Send an email 3) Create a Task 4) Send an outbound message Don’t…

Salesforce Consulting for Small Businesses: Why It Matters in 2024
Small businesses remain the backbone of the economy; however, they usually need more resources to scale efficiently. One of the significant challenges small businesses face…
Popular Salesforce Videos
4 Tips on How to Build Product Messaging & Positioning That Stands Out | Salesforce on Salesforce
Messaging and positioning work together and should be the North Star for any product launch. If done well, it will set you apart from the…
How to Set Up Salesforce Essentials
Watch through to the end for a quick link to our Hands-on Workshops and Training. Watch this video for step-by-step instructions on how to get…
Visualforce Training for Beginners : Visualforce Tags in Salesforce
This video helps you to learn following topics: Visualforce Tags Standard Controllers Associating a Standard Controller with a Visualforce Page What are action methods? Action…
Popular Salesforce Infographics

How to Integrate Salesforce with External Systems
Salesforce Connect empowers you to associate Salesforce to external heritage frameworks like Oracle, SAP, DB2, Microsoft SharePoint continuously, without making a duplicate/copy of any single…

Pardot January 2020 Release [Infographic]
HML Personalisation on Landing Pages and Forms What: HML is the new way to add personalization to Pardot marketing assets, replacing variable tags – you…

How do People Spend Time on Salesforce?
The average salesperson spends 4 hours per week updating his or her Salesforce CRM. However, this is hardly enough—the average salesperson only manages to complete…