• Bushra Anjum
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Thanks to the Trailhead module regarding APEX Rest callout I know how to post "mighty moose" to an endpoint ;-)

I am wondering how I can create and send a JSON string based on Salesforce fields. For example I want to send a case to an external system via a REST Post method with the following field mapping:
Ticket Number = CaseNumber
Ticket Status = Status
Ticket Priority = Priority

How would I change the request.setBody('{"name":"mighty moose"}'); line to succesfully generate the required JSON code for the external system?