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>
    <label>Acknowledgment JSON</label>

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 '20 at 18:08

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)

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.