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