Posts

Community Deployment: "The priority is higher than the maximum stored priority."

We got this error when deploying Communities. The priority is higher than the maximum stored priority. Use a lower priority.Details:Personalization Target Info ID - 6At8G0000004M8ASAU,Target Type - ExperienceVariation,Target Value - Home_ESMX_Theme_Navigation_Menu_8_Component_Properties,Group Name - d9b26ca9-27fd-4ac1-a965-d4c7e0a32bbb$#$16ddf820-1ec5-4e9d-beed-950c2814e4de,Publish Status - Draft,Group Priority - 9 There is very little information on the Google machine about this error specifically. We found that we got this error because we did not include all our Audiences in the deployment.

"component IDs must be unique" when deploying Communities

Image
 Communities are notoriously difficult to deploy. One error we ran across that was maddening was the following: Several components in Support_Community/views/2023SearchEnglish.json , Support_Community/views/2023SearchClientCommunity.json share the same ID, but component IDs must be unique. Replace the following duplicates and try again. 77200210-1d47-414e-b202-8b72cc746faa ExperienceBundle is a group of JSON files. It's meant to be deployed a one thing to wholly replace the one in your destination org, just like any Apex class or other metadata. We found that in our case, Copado was inserting files from the destination branch that were no longer present in the ExperienceBundle.   Apparently, files in a subsequent export of the ExperienceBundle are likely to include duplicate IDs to those in prior versions, thus the conflict. The solution was to go into git and delete the file from the destination branch, so Copado didn't have anything to merge into our current promotion. Philos

Creating a ZIP File for Salesforce on a Mac

 A few posts out there about how the Mac Zip utility won't create a ZIP file with the proper data structure. This one was given to me by a friend and it worked well. I used this to create a deployment package, but I imagine it would work for static resources as well. zip -r What-You-Want-Your-Zip-File-To-Be-Called.zip ./Folder-With-Your-Content -x "__MACOSX" -x ".*" 1. Navigate to the parent folder in Finder (the folder that "Folder-With-Your-Content" is in). Say, it's called "Deployments." 2. Hold down Ctrl and right click the parent folder. Then choose "New Terminal at Folder." 3. You will get a new Terminal window with the name of your folder and a % sign, e.g., Deployments % Then paste the command above, swapping out the two values for your real folder names.

Free Utility: StringUtilities

I've created a utility that will allow you to invoke any of Apex's String methods from a Flow.  Hope this is useful to some of you out there. I've provided very straightforward instructions on how to use it -- Although this is code, there are no code skills required to use it. View on GitHub

View All Data is not, in fact, View All Data.

 If I grant you View All Data permission in Salesforce, you can indeed view all data, if field level security allows you to see the field first. So if you don't have permission to My_Object__c.My_Field__c, that field doesn't exist, even if you can View All Data. The below script will go over a set of objects and grant read permission at the object and field levels. It is super ugly, but it works, and beats going through seven thousand slow-as-**** screens to add each field individually.

Setting a DateTime to a Weekday in a Formula

Image
This is one of those things that took way too long to sort out. WEEKDAY() is a great formula function, but it only works on Dates.  Our requirement was to set the value to three days from now, but only if the day is a weekday, and put it in a datetime field. Thinking it through, they wanted the result to come out as follows. Cases received on Monday are due Thursday (+3 days) Cases received on Tuesday are due Thursday (+3 days) Cases received on Wednesday are due Monday (+5 days, skipping 2 weekend days) Cases received on Thursday are due Tuesday (+5 days, skipping 2 weekend days) Cases received on Friday are due Wednesday (+5 days, skipping 2 weekend days) Cases received on Saturday are due Wednesday (+4 days, skipping 1 weekend day) Cases received on Sunday are due Wednesday (+ 3 days) WEEKDAY() returns  an integer value, where 1 is Sunday and 7 is Saturday. Therefore: CASE(WEEKDAY(TODAY()), 4,now()+5, 5,now()+5, 6,now()+5, 7,now()+4, now()+3 ) Since WEEKDAY() only works o