-
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
Debugging in Salesforce | All You Need to Know
Debugging is a key part of software development, including Salesforce development. Debugging in Salesforce is the process of identifying and fixing errors or problems in…
New Summer '22 Salesforce Flow Updates
Numerous areas of Salesforce that formerly needed specialized programmers no longer necessitate the hiring of developers. Salesforce Flow Builder is now the key tool for…
Agentforce SDR Agent: What It Is and How It Works
Modern sales teams face increasing pressure to engage prospects faster, qualify leads accurately, and maintain personalized communication throughout the customer journey. As customer expectations continue…
Popular Salesforce Videos
How To Get Exam Voucher For Salesforce?
Wondering How To Get Exam Vouchers For Salesforce? Join this useful group for Salesforce job & career info and learn all you need to know…
Strange Requirements | Manual Round Robin ID in Salesforce
In this video, you will learn to create a Manual Round Robin ID using custom Apex in Salesforce. The requirement was to create a Round…
Google Gantt Chart with Colorful Bars in Salesforce Lightning
In this video, you will learn to implement the Gantt Chart with colorful bars in your Salesforce org. We will use Google Gantt Chart scripts…
Popular Salesforce Infographics
Salesforce Administrator Salaries – Around The World
A Salesforce administrator; the gatekeeper to an organisation’s Salesforce capabilities. With the huge acceleration of data in our lives, it’s no surprise that job roles…
Unlock Efficiency & Growth: Key Salesforce Managed Services Benefits
Techforce Services is a leading Salesforce consulting and implementation partner, helping businesses across industries harness the full power of Salesforce. With certified experts and a…
Top 5 ETL Tools for Salesforce Data Migration
There are plenty of ETL tools for Salesforce in the market, with varying degrees of functionality and popularity. All tools are more or less the…