Troubleshooting DLRS 101

      No Comments on Troubleshooting DLRS 101

Hey long time no help. Sorry about that, M&A’s, new jobs, and babies make for quite a hectic time.  Enough with that onto the good stuff!  Top issues people run into with DLRS

  • First Remote Site Settings Errors! 

Lots of people have noticed that after they spin up a sandbox or have an org migration that their DLRS keeps popping up a warning message along the lines of “Salesforce Metadata API connection failure, click the link below to configure”.

DLRS works with the Metadata API to deploy triggers directly into production from production.  If you regularly deal with deploying apex this is pretty magic in what it does.  The key to this is the remote site settings and the way DLRS does this is it uses a hard-coded value for your cluster.  Downside, if you move clusters or create a sandbox to test DLRS items, etc… The two ways to fix this is delete the remote site setting and let DLRS re-create it or just go into the remote site setting and change the server to the current cluster you are in.  Example is say you are on na2 and you spin up a sandbox and it is cs50.  You’d go into the remote site setting and change it from https://dlrs.na2.visual.force.com to https://dlrs.cs50.visual.force.com and it should start to work again.

  • Missing Child Trigger

You’ve probably tried to save a new DLRS and you get an error that looks something like this.

“Active: Apex Trigger dlrs_contactTrigger has not been deployed. Click Manage Child Trigger and try again.”

If you are using the Custom Metadata you wont even see the Deploy Child Trigger button until the DLRS record is saved so you might be a bit confused on how do you save if there isn’t even a way to deploy!  The easy fix to this is UNCHECK the active box, save the DLRS, deploy the child trigger then edit the DLRS and recheck the active box.

  • Im on DLRS (Enter Not Current Version Here) how do I upgrade?

You can just go to the Git page and install the newest version and it will auto upgrade itself.  If you are more cautious you could uninstall the older version and then update to the newest version.  As always highly recommend installing into sandbox first to make sure nothing breaks 😉

  • Error when deploying child trigger about Object not supporting triggers?

You might see this error when trying to deploy your child trigger you might and an error that looks something like this

Error:
triggers/dlrs_OpportunityCompetitorTrigger.trigger (Line: 4: Column:9) : SObject type does not allow triggers: OpportunityCompetitor

This means that the object doesn’t support triggers and you will need to use a Schedule Calculate or have DLRS Called from Process Builder.  To check if an object can use triggers you can go to workbench then click on the Info and select where your object lives.  Pick your object and click on the attributes folder and look for “triggerable:True”.

Another issue you might run into is the SObject type does not allow insert/delete/update and that means that the object only supports certain type of calls.  The fix for this would be to use Process Builder or modify the DLRS trigger to not fire on the type of call that isnt supported.  To see what is supported for an Object the Developer SOAP guide should have a list of what an object supports.

  • When using DLRS to Count follow this one tip!

Pretty much best practice is to have the Field To Aggregate set to ID.  That seems to fix most counting DLRS issues.

  • What the hell? (Is this broken OR am I doing something wrong)?

So I went to workbench to work on my relationship query and I got it working.

Loads_To__c = ‘Highly Desirable’ OR Loads_From__c = ‘Highly Desirable’

But then when it put that into DLRS I get an error! What the heck?

Error: Relationship Criteria ‘Loads_To__c = ‘Highly Desirable’ OR Loads_From__c = ‘Highly Desirable” is not valid, see SOQL documentation http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_conditionexpression.htm, error is ‘unexpected token: OR

The answer is any OR statements in DLRS need to be wrapped in parenthesis. So you’d need to write that out like this (Loads_To__c = ‘Highly Desirable’ OR Loads_From__c = ‘Highly Desirable’) then it should work.  Even if you have an OR and then ANDS after it you need to wrap the entire OR statement for DLRS to accept it.

  • Trying to uninstall DLRS and it is telling me triggers still exist! How do I get rid of them?!

Go to your DLRS records and click on the manage child trigger. Remove all the triggers and you should be good to go to uninstall. If you already have removed your DLRS records you can just re-create new ones that point to the same child objects then via the deploy child triggers button you can remove the triggers.  You can also remove them in Sandbox and then use a change-set to remove them from production.  You can also use destructive changesets via workbench if that is a more familiar route.

  • My DLRS isn’t working as expected! Halp!

Don’t worry there are plenty of people willing to offer help in the community.  Drop on by and post and most likely someone can help you figure out whatever the issue is.  You can also post in the GitHub but it is not as active and more for bug reports but that is another avenue you could take.

Mass Delete List View Button in Lightning!

      No Comments on Mass Delete List View Button in Lightning!

Remember how I said I’d find a way to Mass Delete error records in lightning? Well here it is! (And shown in Lightning as well, you only need to use this for Lightning as you could use the JS Button for Classic)

Step 1 – Download this from Salesforce Labs (https://appexchange.salesforce.com/listingDetail?listingId=a0N300000016YuDEAU)

Step 2 – Clone one of the VF Pages

Step 3 – Replace this in the cloned page with the custom object you want the button to live on

Step 4 – Make new button

Step 5 – Add it to the search results

Step 6 – Mass Delete!

Side note after writing this up I see in 2.9 someone added a VF page button that does the same thing.  WELL THE GOOD NEWS IS THIS WORKS WITH ANY OBJECT IF YOU HAVE ANY OTHER OBJECTS YOU WANNA ADD A MASS DELETE BUTTON TO 😉  The only difference is in editing the VF page you’d put the object API name where we put the DLRS object name and you’d most likely want to name the page something different.