This works:
{!URLFOR(
"/lightning/o/Objective__c/new?defaultFieldValues="
+ "Plan_of_Care__c=" & CASESAFEID ( Plan_of_Care__c.Id )
+ ",Name=" + URLENCODE(SUBSTITUTE(URLENCODE( LEFT ( "Objective for " + Plan_of_Care__c.Name , 80 ) ), ',', '%2c'))
+ "&backgroundContext=%2Flightning%2Fr%2FPlan_of_Care__c%2F" + CASESAFEID ( Plan_of_Care__c.Id ) + "%2Fview"
)}
This doesn't work:
{!URLFOR(
"/lightning/o/Objective__c/new?defaultFieldValues="
+ "Plan_of_Care__c=" & CASESAFEID ( Plan_of_Care__c.Id )
+ ",Name=" + URLENCODE( LEFT ( "Objective for " + Plan_of_Care__c.Name , 80 ) )
+ "&backgroundContext=%2Flightning%2Fr%2FPlan_of_Care__c%2F" + CASESAFEID ( Plan_of_Care__c.Id ) + "%2Fview"
)}
I would think that URLENCODE would handle the commas without me having to manually replace them---what am I missing?
I ended up having to go forward with the option in my original post that uses the SUBSTITUTE function