8

I need to send an email if a particular lead is not opened after 2 days of assignment. There is a field called IsUnreadByOwner, but we cant access this field through workflows or formulaes.

Is there way we could have this field or available in workflows.

Another alternative i had thought was to create a custom field which would hold the value in IsUnreadByOwner. But the question arises of how would one populate this field. When IsUnreadByOwner field is updated, the update triggers dont fire.

Or should i do a batch file to update this field?

Any thoughts?

6

There is the idea that is worth promoting: Create workflow based on unread leads

As you have found, the IsUnreadByOwner field changing doesn't fire an update trigger.

Could you use the difference between the CreatedDate and LastModifiedDate fields in a formula to indicate the record has been processed? Maybe combined with the OwnerId and LastModifiedById fields.

A slight variation would be to create a trigger that sets a custom UpdatedByOwner field if the LastModifiedById ever equals OwnerId.

Neither of these approaches would indicate the owner has only looked at the lead. They would need to at least modify it. You could embed a Visualforce page on the Lead details page that would set a custom boolean field the first time the owner opens it.

Finally, in Summer 13 there are some new SOQL features coming. One of these if FOR VIEW:

FOR VIEW and FOR REFERENCE SOQL Clauses
Update objects with information about when they were last viewed or referenced using the FOR VIEW and FOR REFERENCE clauses, respectively. A record is considered viewed when the user sees the details associated with it, but not when the user sees it in a list with other records.

It isn't clear how we benefit from the FOR VIEW clause in the release notes. I.e. is there a field that this data is available in? It does however sound promising.

When the Lead Assignment is done you could use FOR VIEW or FOR REFERENCE to set the LastViewedDate or LastReferencedDate respectively. Then, when the Lead is read by the owner you would need to do a FOR VIEW SOQL query. With these two parts in place you could query the LastViewedDate column to find if the Lead has not been opened within two days of assignment.

| improve this answer | |
  • 1
    Is there a field that this data is available in? Yes there is, the LastViewedDate (as well as a LastReferencedDate). I found them while schema browsing and was interested and excited – Daniel Blackhall Jul 9 '13 at 2:21
  • @DanielBlackhall Ah, so the LastViewedDate column will be automatically updated if I do a SOQL call using FOR VIEW and LastReferencedDate will be updated if I do a SOQL call using FOR REFERENCE.(or FOR VIEW) – Daniel Ballinger Jul 9 '13 at 2:58
  • Based on the explanation in the docs that is how I understand it works. I also infer that viewing a record through the Salesforce UI also updates the Last Viewed Date. – Daniel Blackhall Jul 9 '13 at 3:43
1

I would recommend creating a scheduled report that sends daily to managers, which filters for leads where lastTranferDate > 2 days ago and unreadByOwner = true (since this field can be reference in reports. Also, this is a great list view (name it "Stale Leads") and train users on what it contains and that they should check it daily.

This should save quite a but of work with having to do a lot of customization, in my opinion.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.