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

DLRS fails rollup on Checkbox when no records found #379

Closed
DanDonin opened this issue Aug 18, 2016 · 8 comments
Closed

DLRS fails rollup on Checkbox when no records found #379

DanDonin opened this issue Aug 18, 2016 · 8 comments

Comments

@DanDonin
Copy link
Contributor

When DLRS is rolling up a checkbox if no records are found to rollup then it will spit out an error of

INVALID_TYPE_ON_FIELD_IN_RECORD.

I think it is because when DLRS finds no records it goes to NULL the value on the rollup on the Parent. Problem is Checkboxes only take TRUE/FALSE not Null so it triggers this issue. Possible workaround is a checkbox on the DLRS record of "Is the rollup a checkbox?" and if this is checked then when no records are found DLRS sends a FALSE statement in-place of a NULL statement.

@afawcett afawcett added the bug label Aug 18, 2016
@afawcett
Copy link
Collaborator

Thanks @DanDonin makes sense, and should be an easy fix. Once again, great having your support, you rock! 👍

@wes1278
Copy link
Contributor

wes1278 commented Oct 25, 2016

@afawcett do you have a branch of this bugfix started?

@DanDonin I found a workaround for this! Create yourself a formula field that is checkbox output. And then just use this as your formula value: "IF(your_original_checkbox_field__c, true, false)" and then use that as your field to aggregate. And then add your_original_checkbox_field__c as a Relationship Criteria Field.

And it works for me!

@wes1278
Copy link
Contributor

wes1278 commented Oct 25, 2016

I lied, sort of. :) My child record that used to meet the criteria no longer meets the criteria, DLRS still tries to write null regardless of what my Field to Aggregate evaluates to. However, if the records continue to meet the criteria and the checkbox changes from true to false, it will work as expected.

@wes1278
Copy link
Contributor

wes1278 commented Oct 25, 2016

@afawcett

My dev machine is all discombobulated. Here is a gist with a headstart to fix this, I think at least. :)

https://gist.github.com/wes1278/e9d992cb289f5f2d31b451f5cf820b90

@afawcett
Copy link
Collaborator

afawcett commented Dec 4, 2016

#discombobulated love it, thanks for sharing!

@afawcett
Copy link
Collaborator

afawcett commented Jan 4, 2017

Fixed in v2.6.

@afawcett afawcett closed this as completed Jan 4, 2017
@JodieM
Copy link

JodieM commented Jan 4, 2017

Yay! Thanks for the release of this one @afawcett I have something in prod that is having this error now.

@afawcett
Copy link
Collaborator

afawcett commented Jan 8, 2017

Thanks to @wes1278 for the patch also. 👍

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

4 participants