Sunday, September 3, 2023

In zsh, SF CLI retrieving classic email template in Unfiled Public folder

 This seems to be a zsh-only issue, for Salesforce devs who now have followed Apple's recommendation to use zsh as the default shell.  The successful command to retrieve a template needs to be like this:

 sfdx project retrieve start -m EmailTemplate:"unfiled\$public/Employee_Created" -o myDevOrg

The key here is to escape the dollar sign, but not the slash.

Thursday, August 31, 2023

installedPackage

 Is it a sign of folks being out of their depth when they stored installedPackage metadata in a repo for stuff for an unpackaged org?  Maybe I'm asking for too much.

Wednesday, August 30, 2023

Find a child relationship by name in Salesforce

 This Apex snippet is useful if your deployment fails with "relationship already exist" - usually it's not straightforward to find relationships from the parent side (this sounds like some kind of bad social advice 😂).  I got the idea from a post on StackExchange (forgot to save the reference, dang), and adapted it a little.


Sunday, December 11, 2022

Battery for car's key fob

 My car has been giving me "key battery low" message for a little while, so it's time to get a new battery.  I still have a required CR2025 battery on hand (probably there for a couple years already), so went ahead to try it.  The key didn't operate at all with it.  I tested the battery voltage: the current one has about 2.92V, and the replacement has 3.2V.  This thread mentioned that old battery may not be able to deliver required current.  I tested the replacement battery (using 200 mA ammeter) and it started with about 150mA reading and quickly dropped to stabilize at 60 mA.  I also tried a CR 2032 I have (probably old as well) and that didn't work either.  That one reads about 60 mA too.  Maybe it's time to get some new CR2025 and see.

Update: the new CR2025s did work.  I measured the battery being replaced, and its current read about 90 mA.  The new battery has 3.3 V output (didn't measure the current).

Tuesday, June 28, 2022

Why am I getting "results not found" from the existing dataset in a CRM Analytics Trailhead org?

If you just signed up a Trailhead Playground org with CRM Analytics provisioned to learn some CRMA skills, this post is about a somewhat baffling issue you might stumble upon when playing with what you're handed with.  Or in my case, I was going to use it for some simple demo and thought it's a great way to have some data to play with, without messing with any org I can access but shouldn't for the purpose.  

The learning org I got had a "salestest" app, which contains a whole bunch datasets already.  Perfect, let's use them to build stuff.  When I started exploring the datasets, however, I got this blank welcome: "No results found".

How could it be?  The dataset has 20+ rows based on what I see in the Data Manager.  Could it be permissions?  But I created the org and am the owner of everything.  Then I started to remember that CRMA uses somewhat more convoluted (or maybe flexible) way of managing permissions.  Better check the security predicate.  Lo and behold, all of them have some form of it.

 

I should still be the owner of things right?  Nope, the existing CRMA data in "salestest" are owned by a bunch of Chris Rileys and Laura Palmers, with role names like Sales WW and Sales EMEA.  So, no luck with any of the predicate matches.  

In the end, the solution for me was to go in and wipe out the predicates.  So, there's bound to be noobs like me who got confused for a while, and hopefully this ends up helping some of them...