function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Meenakshi PisupatiMeenakshi Pisupati 

How to know when Opportunity Score (IqScore) gets updated?

Hi all! 

We have Einstein opportunity score enabled in our org (which helps with scoring opportunities) . I am looking to update a custom field with the value from Opportunity.IqScore field when IqScore is updated.

I tried to handle this in before update trigger but IqScore field's value doesn't get pulled in trigger.new. If I query the field, I am able to retrieve its value but this doesnt work because when IqScore gets updated, the trigger doesnt get kicked off. I noticed that the lastmodified date doesnt change on the opportunity though the IqScore gets updated after a couple of hours from when the opportunity gets updated. 

Another option is to do a batch but this will end up in querying all opportunities with an iqscore without a criteria check on lastmodified within x hrs because the lastmodified date doesnt get updated when Iqscore is updated. 

Has anyone encountered a similar situation and found a solution? Please let me know your thoughts! 

Thanks,
Meenakshi
Eddie AdamsEddie Adams
Bumping this. I, too, would like to know if there's a plan to have the SystemModStamp update when the IqScore changes.
Meenakshi PisupatiMeenakshi Pisupati
Hi Eddie! From my experience, we can't update sysModstamp in this case but there is a workaround - there is an 'Opportunity score' object on which we can build a flow (previously I did a process builder) -> when record is created/edited -> if OpportunityScore.Score > 0 (i.e a score is added on an opportunity) -> do the processing you want (like update field on related opportunity that updates sysmodstamp). Hope this is helpful. 
Eddie AdamsEddie Adams
Thank you for that feedback, Meenakshi! I don't see 'Opportunity score' in our Object Manager. Do you know if it's only available via Salesforce's analytics offering or something else (beyond the standard object offering)?
Meenakshi PisupatiMeenakshi Pisupati
It is a backend object that isn't visible on the object manager, but if you go to build a process builder, it will be available in the objects list of the process builder. I haven't checked if that can be accessed in a flow or in the code but you will find it for sure on a process builder. 
Meenakshi PisupatiMeenakshi Pisupati
Looks like this. Salesforce support team pointed me to this object, so in case you don't find this object, they might be able to help. 
User-added image