Call us: 555-555-5555

BLOG

Useful Stuff

By Mike Arthur 16 Aug, 2017
No content of my own here, just a pointer to someone who really knows what he's talking about, Peter_sfdc, the mighty Peter Chittum, check out his reply here:
https://developer.salesforce.com/forums/?id=906F0000000AcdaIAC

(Of course, if you don't have a good reason to use Apex, you can always go with Flow, as explained by the equally mighty Mike Gill:
http://www.salesforceweek.ly/2015/02/how-to-create-roll-up-summaries-using-flow.html
http://www.salesforceweek.ly/2015/02/how-to-create-roll-up-summaries-using-flow-part-2.html )
By Mike Arthur 14 Aug, 2017
Thanks to Keith Clarke for the code posted here:
https://salesforce.stackexchange.com/questions/84256/counting-query-results-and-displaying-them-in-v...

I used that and adapted it and it worked a treat :-)
By Mike Arthur 20 Jun, 2017
If you see this error when trying to save a Flow, there doesn't appear to be any further information available.  But there is!

Click 'OK' and, in Windows, press ctrl-shift-M, or Mac command-shift-m.  You will then see diagnostic information.  Click each box until you see something useful.

In my case, the Flow had been deployed from another org but the field level security on one of the referenced fields did not allow access.
By Mike Arthur 15 Jun, 2017
I was building a Process Builder so that if a field on one object is updated, the corresponding field on another object is updated with the same value. Another PB operates in the opposite direction to keep these fields in sync.

The (pre-existing) fields were Object1__c.Custom_Type__c and Object2__c.Custom_type__c.

The PB to update Object1 when Object2 is changed kept failing with 'The flow failed to access the value for myVariable_current.Custom_Type__c'.

I tried many ways of ensuring that Custom_Type__c was not blank before checking ISCHANGED(Custom_Type__c), which is one of the most common causes of this error.

However, I then noticed that the error was reporting on field Custom_Type__c, whilst the actual field API name is Custom_type__c. I amended my formula in PB to Custom_type__c and all is good.

So PB will let you create a formula using a valid API name but with incorrect case, but will then fail at runtime. Nice!
By Mike Arthur 25 Apr, 2017
After adding a row limit to a tabular report, the 'Dashboard Settings' button should appear.  In one client org we just couldn't find the button.

I logged a Case with Salesforce Support and it turns out that 'sometimes it just doesn't get added'!

Support ticked a checkbox somewhere and our lovely 'Dashboard Settings' button was shining brightly.
By Mike Arthur 24 Feb, 2017
Knowing which of your products have never been added to an Opportunity is a good thing to know.  Unfortunately, you can't get that answer with Reports, but it's easy to find out using Workbench.

You need to be on Enterprise Edition or higher´╗┐, as Professional Edition and below don't have access to the API.

- go to https://workbench.developerforce.com
- click 'agree to terms' and login
- Select 'SOQL Query' in 'Jump To' picklist, leave 'Object' blank, click 'Select'
- In the 'Enter or modify a SOQL query below' box paste this
  select name, productcode, id from product2 where id not in (select product2id from opportunitylineitem)
  Click 'Query'
- This is the list of products that are gathering dust (good description @SteveMo :-) ).
- You can copy the results to paste somewhere else
- Copy the url showing in the address bar and save it somewhere. Just paste it back into browser at some later point and it will run the same query.

You can paste the same query into the Developer Console but the results are easier to copy and you can return to the query by revisiting the url when you use the Workbench option.
By Mike Arthur 20 Feb, 2017
MavensMate and Sublime Text are a great combination for developing in Salesforce and moving config between orgs.  For  installation instructions there's a great resource here:
https://www.xgeek.net/salesforce/sublime-text-3-mavensmate-for-salesforce-development/

However, I sometimes end up in a bit of a loop when trying to create a new project and select the metadata types that I want.  So, for future reference, for me and others, here are the steps to create a project in MavensMate and select your metadata types:

  1. From the Hopme tab click on the Menu and 'New Project'. Fill in the blanks and remember to add Security Token to Password
  2. Close MM. Start MM. Open above Project
  3. Menu - Project - Edit Project
  4. Advanced Tab - Select Metadata Types to index. Click 'Update Subscription' then 'Refresh Index' and 'Update Project' at top right.
  5. Click 'Refresh' on the 'Project Metadata' tab
  6. Tick the boxes and click 'Update Project'

By Mike Arthur 14 Dec, 2016
One of the steps when importing attachments from a data export is to rename the actual attachment files back to their real name because the real name is replaced with a record id in the data export.

If the filenames contain international characters, such as umlauts, these can be replaced with 'garbage' characters when you perform the rename operation at the Windows command line.

To stop this happening, type 'chcp 1252' at theWindows command linebefore performing the rename.  This changes the Code Page so that the characters are recognised and retained in the renamed filename.

For more information, see:

How do I import attachments using my Data Export files?

Renaming exported Attachments/Documents files in a data export

CHCP

By Mike Arthur 09 Dec, 2016
So you're trying to import some data and it bombs out with the error 'bad value for restricted picklist field:...'.
The value in your csv matches the value in Salesforce exactly, because you copied and pasted it.
What's the problem?
Make sure that the picklist values are enabled for each Record Type.  This is an easy step to miss if you have set up aGlobal Value Setand assigned it to a field as a Global Picklist.
By Mike Arthur 30 Nov, 2016
Getting the field names right when creating a Word Mail Merge template to use with Salesforce Extended Mail Merge can be frustrating and time consuming.

However, if you navigate to a record in Salesforce, e.g. a Lead, the url will be something like

https://cs99.salesforce.com/00Q99000002Kwwp

Now, if you paste 'servlet/servlet.SForceMailMerge?id=' after the 'com/' so that it looks like

https://cs99.salesforce.com/servlet/servlet.SForceMailMerge?id=00Q99000002Kwwp

You get a (not very pretty but very useful) list of the Mail Merge fields that you can copy and paste into your Word doc.

Thanks dacology.

More Posts

Useful Stuff

By Mike Arthur 16 Aug, 2017
No content of my own here, just a pointer to someone who really knows what he's talking about, Peter_sfdc, the mighty Peter Chittum, check out his reply here:
https://developer.salesforce.com/forums/?id=906F0000000AcdaIAC

(Of course, if you don't have a good reason to use Apex, you can always go with Flow, as explained by the equally mighty Mike Gill:
http://www.salesforceweek.ly/2015/02/how-to-create-roll-up-summaries-using-flow.html
http://www.salesforceweek.ly/2015/02/how-to-create-roll-up-summaries-using-flow-part-2.html )
By Mike Arthur 14 Aug, 2017
Thanks to Keith Clarke for the code posted here:
https://salesforce.stackexchange.com/questions/84256/counting-query-results-and-displaying-them-in-v...

I used that and adapted it and it worked a treat :-)
By Mike Arthur 20 Jun, 2017
If you see this error when trying to save a Flow, there doesn't appear to be any further information available.  But there is!

Click 'OK' and, in Windows, press ctrl-shift-M, or Mac command-shift-m.  You will then see diagnostic information.  Click each box until you see something useful.

In my case, the Flow had been deployed from another org but the field level security on one of the referenced fields did not allow access.
More Posts
Share by: