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
Glenn at MvistaGlenn at Mvista 

Manage Contacts based on Entitlement Contact existence and Entitlement Status

We are using Service Contracts and Entitlements to manage how our customers get support, and also when they should be allowed to activate a Customer Portal login.  The create/activate works but I am having a problem getting the delete/inactivate part going.  The problem is this, we give access to certain parts of the portal as well as our internal FTP site based on the entitlements to which a Contact is associated.  When that Entitlement expires, I need a mechanism that will check the Contacts related to the entitlement, then check each of those contacts to make sure they do not have an other active entitlements, and if so, deactivate their Customer Portal User Login.

I was really hoping to simply use a Roll-Up Summary field on the Contact, that would count the number of active entitlements to which a contact is associated, and then use that to trigger the update.  However, the many-to-many Entitlement Contacts related list does not show that the entitlement is expired, nor does it allow custom fields (so I cannot create a formula field on the object that pulls the status from the Entitlement).  So I am able to get a Total count, but not an Active-only count.

Has anyone encountered this and solved it?  Any info, direction, encouragement I can get would be appreciated.
pconpcon
Unfortunately I think your best option would probably be to run a daily scheduled job that then updates a feild on the contact.  You should be able to get the information needed with an AggregateResult query and then update the contacts that way.  It's a little cumbersome but should get you there.
Glenn at MvistaGlenn at Mvista
That is probably the best way, I was hoping for a magic bullet.  Thanks!