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

Object related to itself does not seem to work #10

Closed
mkdjns opened this issue Jan 21, 2014 · 12 comments
Closed

Object related to itself does not seem to work #10

mkdjns opened this issue Jan 21, 2014 · 12 comments

Comments

@mkdjns
Copy link

mkdjns commented Jan 21, 2014

Attempting to add a Rollup Summary where the same object os on both sides of the relationship doesn't seem to work. For example, the rollup in this screenshot does not update the Parent Account when modifying the Child Account

screen shot 2014-01-21 at 8 02 38 am

@mkdjns
Copy link
Author

mkdjns commented Jan 21, 2014

Ah, scratch that. I was misunderstanding how the trigger understood what it needed to do. I was assuming that by creating the relationship (that is, by populating ParentId) the parent account would be updated to reflect the NumberOfEmployees on the newly related account. I seems that you must modify the field that is being rolled up.

@afawcett
Copy link
Collaborator

Yes thats correct, it has some optimisations in it to compare the rollup field for changes and thus avoid excessive queries if nothing has actually changed. Are we cool to close this issue you think?

@mkdjns
Copy link
Author

mkdjns commented Jan 23, 2014

I think so. It would be nice to have the rollups recalculated if a relationship is added/deleted, as that's my initial use case for this. But, also understand how intensive that may be.

@afawcett
Copy link
Collaborator

I am working at present on the Calculate and Schedule modes, just got back from a long US trip, so maybe next weekend for release. In the meantime, when you say 'recalculated if a relationship is added/deleted', can you clarify the steps, i think i know what you mean, just want to confirm. Thanks!

@mkdjns
Copy link
Author

mkdjns commented Jan 24, 2014

So, per the screenshot I attached, I was expecting that creating a new relationship between two accounts (using the ParentID field) would recalculate TotalEmployees__c on the parent account if I populated ParentID on the child account. Similarly, if I removed the relationship (set ParentID to null) or changed it (set ParentID to some other account) I would expect the rollup to be recalculated for all of the involved accounts.

A simpler version of my use case is to think about tallying number of employees for Starbucks. Starbucks corporate is the parent with local stores as children. If I learn about a new store, I can add it to Salesforce with the number of Employees, set the ParentID to Starbuck Corporate, then sen the TotalEmployees__c field on the corporate account update with a new total.

@afawcett
Copy link
Collaborator

Ah I understand, this is a bug in my view, i'll take a look, thanks!

@afawcett
Copy link
Collaborator

afawcett commented Feb 7, 2014

Taking a look at this now! :-)

@afawcett
Copy link
Collaborator

afawcett commented Feb 7, 2014

Good news, i've just committed a fix for realtime mode to support re-parenting, it will be released in the next package release when i complete the schedule mode (partially implemented in this latest commit also), which will hopefully be out very soon!

@mkdjns
Copy link
Author

mkdjns commented Feb 7, 2014

That's awesome! Looking forward to giving it a test drive.

Mike

On Feb 7, 2014, at 7:19 AM, Andrew Fawcett [email protected] wrote:

Good news, i've just committed a fix for realtime mode to support re-parenting, it will be released in the next package release when i complete the schedule mode (partially implemented in this latest commit also), which will hopefully be out very soon!


Reply to this email directly or view it on GitHub.

@afawcett
Copy link
Collaborator

afawcett commented Feb 9, 2014

I've just released v1.6, see the Readme and my blog for details! :-)

@afawcett afawcett closed this as completed Feb 9, 2014
@kvonachen
Copy link

Andrew - I'm working on a rollup that is working in the normal sense of parent child objects. But my parent object is Accounts and my record has a Parent Account. How come the rollup isn't calculating the total sum of child records (across all the child accounts) on the Parent record? does this functionality work? I JUST installed the tool today on the org so it's the latest and greatest version! Please advise. Thanks!!

@afawcett
Copy link
Collaborator

Have you seen this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants