Is it possible to use SOQL to list new opportunity contact roles added after a certain date? Ideally I'd like to schedule some apex that runs nightly, queries all new OCRs since the last run, then applies a change to the contacts -- but can this be done with just the new ones, or would it affect all OCRs each time it runs?

1 Answer 1


Hi Matt this is possible. SOQL on Opportunity Contact Role

You can query opportunity Contact Role and have a scheduled batch to perform intended operations on newly created opportunityContactRole. Make sure you apply proper filter like using CreatedDate > :LAST_RUN or CreatedDate = TODAY [Considering you are processing all records.]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .