3

I would like to default some JSON including new lines:

[{
    "text": [...]
}]

in a LongTextArea field:

<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
    <defaultValue>&#39;[{&#10;"types": [...]&#10;}]&#39;</defaultValue>
    <fullName>AcknowledgmentJson__c</fullName>
    <externalId>false</externalId>
    <label>Acknowledgment JSON</label>
    <length>131072</length>
    <trackHistory>false</trackHistory>
    <trackTrending>false</trackTrending>
    <type>LongTextArea</type>
    <visibleLines>10</visibleLines>
</CustomField>

but that markup will not deploy returning the error:

Syntax error. Missing '

as the new line &#39; is being immediately interpreted.

is there a way to do this?

  • 1
    Have you tried & BR() &? Just going off some older discussions here – Kris Goncalves Mar 13 at 18:08
3

There's a great discussion here that outlines how to do it and some of the drawbacks

The short answer is to concatenate the BR() function in your default text where you want a break.

However there are some caveats that you'll want to read about in the above discussion (ex. the field value may not display correctly in Process Builder)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.