Activity Forums Salesforce® Discussions How to resolve missing closing quote 'character ' on string error message in Salesforce?

  • Piyush

    Member
    August 13, 2019 at 3:43 AM

    Hi Deepak,

    Apex doesn't allow multiline string literals, So you need to quote that JSON line by line, and add new lines via 'n':-

    request.setBody('{ n' +
    ' "Fields" : [{ n'+
    ' "Field" : "Name",n' +
    ' "Data" : "Palo Alto Networks"n'+
    ' }n'+
    ' ] n'+
    ' } n'
    );

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Pros & Cons of Lightning Component vs. 3rd party frameworks in Salesforce UI development

Video in

Nikita drops by to share his invaluable experience of using popular 3rd party frameworks in Salesforce. http://media.blubrry.com/salesforceway/audio.xmcdn.com/group42/M05/25/57/wKgJ81rXk6XjaZIAAU_I_KtprFM998.m4a