-
Notifications
You must be signed in to change notification settings - Fork 238
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
I am not a developer so sometime struggle with troubleshooting #197
Comments
Have just tested in a sandbox and rollup works there but not in production |
Actually the test on campaignmember test failed in saandbox |
The generated Apex test by the tool is pretty dumb, in most cases its been fine, but i now see an upturn in cases where it needs more sophstication, unfortunatly the tool itself cannot figure out what code to write on its own. What it can do is make it easier for a developer or someone more technical to give you a snipet of code to give to the rollup tool that it injects that will fullfil these type of requirements. In your case it looks like the CampaignMember child object needs the parent Id. I've got already an enhancement to offer this kind of customisation over the generated test marked here, but i'll leave this one open as a reminder of a use case to test with whatever enhancement feature is produced. In the meantime you will need to get a developer to help you with the generated test. I'll post a blog post in the next few days to outline these types of problems, solutions today, and solutions in the pipeline. Sorry in the meantime for this. POSSIBLE FIX NOTE: One option in this case actually might be to auto generate fake Id's for relationship fields? |
I've recently written up some shared details on the code coverage issue described in this case, please check the details here and comment at the bottom of the wiki page. |
Many thanks Regards +64 274 338 463 (+64 274 DEVINE) Manukau Road Consulting www.manukauroad.com http://www.manukauroad.com On 2 July 2015 at 06:57, Andrew Fawcett [email protected] wrote:
|
Thanks Regards +64 274 338 463 (+64 274 DEVINE) Manukau Road Consulting www.manukauroad.com http://www.manukauroad.com On 2 July 2015 at 07:56, Greg Devine [email protected] wrote:
|
Excellent! As i said in the Wiki hopefully a future version can take some of the tooling pain out of it, if not the coding bit for these such use cases. |
Hey Greg, can you pls explain what you did? Facing the same issue here. thanks |
As I said I'm not a developer - so what i did may have been Regards +64 274 338 463 (+64 274 DEVINE) Manukau Road Consulting www.manukauroad.com http://www.manukauroad.com On 14 July 2015 at 11:28, Rnatik [email protected] wrote:
|
Would you mind sharing @GregDevine the code here for future users with the issue? It's OK if not. |
@GregDevine looks like we've got another user struggling with CampaignMember are you able to paste a snippet of your test code here please? No worries if not. |
Will do
|
No idea if its "robust" - was my first ever test class /**
Regards +64 274 338 463 (+64 274 DEVINE) Manukau Road Consulting www.manukauroad.com http://www.manukauroad.com On 30 August 2015 at 19:40, Andrew Fawcett [email protected] wrote:
|
Thanks for adding your code, @GregDevine - did you just copy the whole thing into Test Code field? I am still getting errors, now about things like setting variables to private or test... /**
|
Just copy this bit... you don't need the See All Data tickbox for this...
|
@GregDevine thanks btw! 👍 |
Sorry for the dumb question but where do I paste the test code? JenNelsonChicago references a Test Code field. Where do I find that? Thanks! |
Take a look at this #307 |
You need to remove some of the lines. It was confusing for me as well. can
|
@Rnatik - I actually deleted my post because I realized that it was a validation problem from within my instance, not an issue with the code Andy provided. THANK YOU for responding, though! I was able to add an additional variable assignment to the test code, and now it works. Again, very appreciative to have this thread with the test code solution. Thanks @afawcett and everyone else! |
Thanks @JodiNA, and btw i keep running up to that NPSP issue and runny away, its really hard to debug, i think i'm going to have to deploy both NPSP and DLRS into an org unmanaged so i can see all the code and get detailed debug logs. Sorry i feel bad its still hanging around that issue. It really requires a day to debug. I'm actually wondering if I could hack it through with an NPSP dev together at an MVP event or something? |
@afawcett - regarding the NPSP issue, I'm not exactly sure where to point you with this one. Judi Sohn or David Habib might be people to reach out to. |
Thanks, are either of them close or in town during the MVP LEX event do you know? |
No idea, sorry! On Fri, Jun 17, 2016 at 1:32 PM, Andrew Fawcett [email protected]
Jodi Nemser-Abrahams Web: www.keshetonline.org Join us for Keshet Cabaret Celebrate Pride Month http://www.keshetonline.org/pride/ with Keshet! Stand up for transgender rights. Sign Keshet's petition |
I'm running into this issue but on a Custom Object. I tried using the Campaign Member code and tweaking but I'm not doing it right. What is the root cause of this issue so I can understand what I'm trying to fix? Is it something that is required for the creation of one of the records that throws the error during the test class? THANK YOU! |
I am getting the same error. Not sure what is applicable to my case from the above comments and solutions. Heres my Error: Here's my test class: No active validation rules on parent or child objects. There are two existing managed triggers on the Campaign object, which shouldn't affect things since this is a Campaign Member trigger. I am wondering whether this code snippet copied from above will fix my coverage: Campaign c=new Campaign(Name='Test'); Where do I put it, in the existing class? Thanks so much. I have never had this issue with a rollup and have yet to write a single line of code, so grateful for whatever light others can shed here. |
you are failing to have an Id |
The test is failing. I have 0% coverage. I didn’t think I SHOULD deploy under those conditions….
From: Jim Bartek [mailto:[email protected]]
Sent: Tuesday, May 21, 2019 2:46 PM
To: afawcett/declarative-lookup-rollup-summaries <[email protected]>
Cc: Ashlynn Sylvain <[email protected]>; Comment <[email protected]>
Subject: Re: [afawcett/declarative-lookup-rollup-summaries] I am not a developer so sometime struggle with troubleshooting (#197)
you are failing to have an Id MALFORMED_ID, Invalid campaign id: null: [CampaignId] . But if you are not a developer, why not just let DLRS deploy the Child Trigger for you? It should come with test coverage and not require you to write any code.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#197>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AJHQZJPROBT55S3G6M7WHY3PWQ7NRANCNFSM4BJXJKMQ>.
|
I am trying to roll up from campaign member to a related Lookup Object (enrolment)
Get this error message when trying to deploy the trigger
dlrs_CampaignMemberTest.testTrigger System.DmlException: Insert failed. First exception on row 0; first error: MALFORMED_ID, Invalid campaign id: null: CampaignId Class.dlrs_CampaignMemberTest.testTrigger: line 10, column 1
Any suggestions what I should be looking for?
The text was updated successfully, but these errors were encountered: