Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to count # of events and tasks an owner has completed; OwnerId relationship field is failing #140

Closed
rwerner88 opened this issue Mar 24, 2015 · 5 comments

Comments

@rwerner88
Copy link

We are trying to count the monthly number of completed tasks and events for each sales rep. Right now we have 4 lookup roll-up summaries running to calculate these numbers. For each of these, the parent field is always User and the child is either Task or Event depending on which it is counting.

When I calculate these rollups manually there are no issues; however when scheduled to run at night with the other rollups in our org the jobs fail. The OwnerId relationship field seems to be the issue and for many of the jobs it is trying to use a Contact, Lead, or Account as the OwnerId along with the User. The Apex jobs lists the error as "First error: Invalid Id for User". In the lookup logs there are a ton of errors listed for all the Accounts, Contacts, and Leads the rollup tried to use as the parent object. Here is an image of one of our rollups so you can see how we set it up:

lookup_error

Any ideas on what's going on? Thanks!

@afawcett
Copy link
Collaborator

Yes i've been seeing these type of errors come through from time to time as the platform emails me unhandled exceptions. I've had a few looks through the code to reverse engineer what might be the issue without success. So don't take this the wrong way, but i'm really pleased you seemed to have reproduced the issue and contact me! 👍

Next up is how to reproduce it in my environment! Its good that you seem to be using all standard objects, so i should be able to setup the rollups as you have done. I do wonder if there is some data sensitive element to it though, but lets see. So next step, can you give me a screenshot of all 4 rollup summaries please?

@afawcett
Copy link
Collaborator

Oh and also can you share some examples of the errors in the lookup logs as well please.

@afawcett afawcett added the bug label Mar 26, 2015
@rwerner88
Copy link
Author

Here are the 4 rollups (one of them is on "developer" mode as we were experimenting with it, but they all are normally ran as scheduled):

1

2

3

4

In the logs there are a bunch of error logs, however they are all identical:

log1

All of the logs are for the Account object as the parent. Under the apex jobs list the error shows "First error: Invalid Id for User"

@afawcett
Copy link
Collaborator

afawcett commented Jun 8, 2015

I'm getting a sense of whats causing this now, i think it has to do with the OwnerId being able to point to different types of objects, not sure if this is possible for Event to have different parents though. Also i think another possible bug is the parent object may have been changed on the rollup, yet scheduled item records might still exist in the system for when the rollup records may have pointed to different parent objects. Are you able to clear the schedule item records from the system and see if you get this error again?

@afawcett
Copy link
Collaborator

afawcett commented Jul 6, 2015

This is a duplicate of this issue 185. Which is now fixed in the GitHub master branch and will be packaged shortly.

@afawcett afawcett closed this as completed Jul 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants