877.703.4488 info@cloudmybiz.com
Tip of the Week – This trick makes Dynamic Reports even better in Salesforce

Tip of the Week – This trick makes Dynamic Reports even better in Salesforce

null

Dynamic Reports in Salesforce are one of our favorite cool tools. With some simple URL hacking, you’ve got a powerful, custom Report based on filtered data ready at the click of a button. But some things can throw off your URL hacking and break your custom Reports. Commas are especially annoying, since they show up in a number of different places and mess with all of your hard work. Not to fear, there’s a simple solution.

If you need to use a text field which contains commas as a filter in a Dynamic Report link, all you need is a tiny update to your URL hack. If you wrap that field in quotes, Salesforce understands and knows what to do from there. But don’t just throw in quotes – they can cause their own problems in the URL. Instead, add the URL code %22, which will be translated as double quotes. As an example, if you were using ?pv0={!Account.Name}, now you’ll have ?pv0=%22{!Account.Name}%22. That simple! To brush up on your Dynamic Reporting skills, don’t forget to review our guide. And good luck with your next cool Report!

-Jared and the Salesforce Guys

Tip of the Week – JavaScript makes multi-select picklists work with dynamic Salesforce Reports

Tip of the Week – JavaScript makes multi-select picklists work with dynamic Salesforce Reports

Multi-Select Picklists in Salesforce can be more than a little finicky, and I typically recommend against them. They’re difficult to work with using Apex and Workflow Rules, and using them for grouping in Reports can get sloppy, as they will group by combo rather than individual values. They can generally be replaced by some combination of standard Picklists and Checkboxes, simplifying automations and improving reporting. That said, sometimes they are unavoidable and definitely the right solution. Don’t worry, though, some simple JavaScript can solve the problems associated with Multi-Select Picklists and Dynamic Reports and make them immensely more valuable.

One thing to know – Report filters expect comma-separated parameters, while Multi-Select Picklists generate semicolon-separated values. If you want a dynamic Salesforce Report to filter based on any values within a Multi-Select picklist, you’re going to need a complex formula or workflow. Or, you could save some time by swapping your typical dynamic report link with onclick JavaScript and use this handy piece of code to save you time, headaches, and future maintenance! All it does is swap semicolons for commas, meaning your dynamic Salesforce Report can search for records matching any values within your picklist! Give it a try and let us know how it works for you today!

var picklist="{!Opportunity.Multi_Select_Sample__c}";
picklist = picklist.replace(/;/g,',');
window.location.href = "/00Oo00000057RCe?pv0={!Account.BillingState}&pv1="+ picklist;

-Jared and the Salesforce Guys