Excluded Score Issues #469
-
Hi @jamessimone Love the package, and it has made life so much easier! I've hit a bit of a snag trying to utilise the package for what seems like a fairly basic requirement, and I'm uncertain of whether there are any other tweaks I can make to counter this problem. I'm currently performing a rollup in a record triggered flow on Contact using the invocable action (not MDT based), where I'm rolling the pi__score__c value from Contact up to the Account Total_Engagement_Score__c field. The entry conditions of the flow is the below which is running in an After context, and further to this, the business has asked to exclude the score value from the account, should the contact have Contact_Sub_Status__c changed into one of the excluded values which I've used SOQL Where Clause to exclude. OR( SOQL Where Clause: Contact_Sub_Status__c NOT IN ('Ceased Trading', 'Employee', 'Local Auth Deals', 'Opt-Out', 'No longer works for company', 'Contact has left the business') The score value from the contact is rolling up correctly as I'd expect, except for one scenario I'm testing for. When we have a contact where the Account Id and the Contact Sub Status is changed in the same action, but the Contact Sub Status is changed to one of the statuses that is excluded in the Where Clause, the score is still added to the Account. Further to this, that score that has now been rolled up is no longer considered part of the ongoing score from that contact. If the Contact Sub Status is changed in a separate action, it does work as intended, and doesn't seem to be a problem should the pi__score__c field and Contact_Sub_Status__c be changed in the same action either. For example, I am changing the Account Name and Contact Sub Status in the same action for a Contact with a pi__score__c of 10, the Contact Sub Status I've chosen is "Ceased Trading". The flow fires, the old account now has a score of 0, but the new account selected has a score of 10 albeit the Contact Sub Status should be excluded. I would go ahead and change the Contact Sub Status field into something not excluded, and the new account would now have a score of 20. That additional 10 score is what causes the problem, given it was added during the account change, but given the Contact Sub Status was changed in the same action to a value that should have been excluded, the rollup added the value initially, but no longer recognises that value. This is also highlighted further when I go ahead and change the Account Name for a second time, the old account would now have a score of 10, and the new account would have a score of 10. I'm not quite sure how to combat this, it's one of those situations where it may not happen often, but it could occur during a merge contact scenario, or in a once in a blue moon situation. Would be really keen to hear your thoughts :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@simoneduckworth thanks for all of those details, that really helps envision what you're trying to do. It sounds like something I should be able to fix - let me try a few things out over the next few days, and I'll keep you updated. |
Beta Was this translation helpful? Give feedback.
@simoneduckworth I was able to reproduce this issue locally - I'm hopeful to include the fix in the next version of Apex Rollup (1.5.76). Worst case scenario it will go out in the version following that, 1.5.77.