0

"For example I have a case named "Test123, 321test" when I clone the case "321test" is considered a new field and breaks the formula.

Here is the formula:

{!URLFOR('/lightning/o/Case/new?defaultFieldValues=ParentId='+(Case.Id)
+',OwnerId='+(Case.OwnerId)
+',Status='+TEXT((Case.Status))
+',Origin='+TEXT((Case.Origin))
+',Priority='+TEXT((Case.Priority))
+',Trending_Topics_Pick_List__c='+TEXT((Case.Trending_Topics_Pick_List__c))
+',OrderID__c='+(Case.OrderID__c)
+',Subject='+(Case.Subject)
+',Description='+(Case.Description)
+',SuppliedEmail='+(Case.SuppliedEmail)
+',SuppliedName='+(Case.SuppliedName)
+',SuppliedCompany='+(Case.SuppliedCompany)
+',SuppliedPhone='+(Case.SuppliedPhone)
+',Language__c='+TEXT((Case.Language__c))
+',Country_of_Origin__c='+TEXT((Case.Country_of_Origin__c))
+',Driver_Category__c='+TEXT((Case.Driver_Category__c))+ IF(ISBLANK(Case.AccountId),NULL,',AccountId='+(Case.AccountId)) )}

Anyone has a clue how I can fix this?

1
  • clone case custom button broken by "," (comma). Commented Oct 28, 2022 at 6:59

1 Answer 1

1

You need to URL-encode the entire parameter:

'/lightning/o/Case/new?defaultFieldValues='+
URLENCODE(ParentId'+(Case.Id)
+',OwnerId='+(Case.OwnerId)
+',Status='+TEXT((Case.Status))
+',Origin='+TEXT((Case.Origin))
+',Priority='+TEXT((Case.Priority))
+',Trending_Topics_Pick_List__c='+TEXT((Case.Trending_Topics_Pick_List__c))
+',OrderID__c='+(Case.OrderID__c)
+',Subject='+(Case.Subject)
+',Description='+(Case.Description)
+',SuppliedEmail='+(Case.SuppliedEmail)
+',SuppliedName='+(Case.SuppliedName)
+',SuppliedCompany='+(Case.SuppliedCompany)
+',SuppliedPhone='+(Case.SuppliedPhone)
+',Language__c='+TEXT((Case.Language__c))
+',Country_of_Origin__c='+TEXT((Case.Country_of_Origin__c))
+',Driver_Category__c='+TEXT((Case.Driver_Category__c))+ IF(ISBLANK(Case.AccountId),NULL,',AccountId='+(Case.AccountId)))
}

Edit: Also note that URLFOR isn't necessary here, since you're not actually using any of the usual properties you'd use URLFOR for. For example, we typically use this function to specify an URL from a global variable with parameters, etc.

For example, an actual use of URLFOR might look like this:

{!URLFOR($Action.Case.New,null,[Status='Open'])}

Since you're not using any of those features, this is unnecessary.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .