You need to sign in to do that
Don't have an account?
Prashant Gulve
Create a job which will run every hour and sync the opportunity and opp products with order and order products.
Create a job which will run every hour and sync the opportunity and opp products with order and order products.
(ex. if amount field on order changes from 100 to 200 then update related opportunities amount field with 200) same for order line items and opportunity line items
(ex. if amount field on order changes from 100 to 200 then update related opportunities amount field with 200) same for order line items and opportunity line items
I would suggest to do the sync between the objects using triggers instead of an scheduled job. that way you won't have to wait any time to see the updated data on opportunities and lines items.
You may use record triggered flows when a record is update then it updats the related parent records. Runnig a Job on that high data would be okay btu may not be best approach.
Thanks,
Then I would suggest using a batch job (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm) (since the number of records could be quite high), querying for opportunities that have changes since the last job execution, and the sync the related order records. and a second job to do the same for opportnity line items and order line items.
you can also refer this document: schedule jobs in apex (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm)