Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
How to use html tag in salesforce task api?

I am using JSForce for make api calls on salesforce. I am trying to add task using this api

const body = `<a href=${process.env.CONSOLE_URL}/myUrl/${id}>Click Here</>`
 const createObj = {
      WhoId: contact.Id,
      Subject: 'Call',
      CallDisposition : 'Call',
      Description : body
    };
 this.conn.sobject("Task").create(createObj, function(err, result) {
    if (err) return reject(err);
    return resolve(result);
  })

It is working as expected except the body(Description) part contains some html tags so it does not parse it instead paste as it is in the comment section. Kindly help.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

The backend probably escapes the html characters when the comment gets uploaded as a security measure; either before it gets stored in the database or before it gets returned to the client.
This should logically be done to disallow users to upload malicious tags and is standard.

Instead of uploading html tags, I would suggest uploading markdown tags in the body(description) instead on which you can find info here.

Then you need a script to convert the markdown back to html before rendering it.

about 4 years ago · Juan Pablo Isaza Report

0

Description is a plain-text field and as such it won't parse HTML. Generally speaking, the solution is to add a custom field of correct type to your object and populate this field. A field type that allows HTML and/or other markup is Text Area (Rich):

Text Area (Rich)

[...] users can format the field content and add images and hyperlinks. [...] The maximum field size is 131,072 characters, inclusive of all the formatting and HTML tags.

Unfortunately Activities (Task is a type of Activity) do not allow custom fields of Text Area (Rich) type. Another field type that is available for custom fields on Activities is URL:

Allows users to enter up to 255 characters of any valid website address. Only the first 50 characters are displayed on the record detail pages. When a user clicks the field in Salesforce Classic, the URL opens in a separate browser window. In Lightning Experience, internal URLs open in the same window and external URLs open in a separate browser window. In Salesforce console apps, the URL opens in a new workspace tab. In Lightning console apps, internal URLs open in a new workspace tab and external URLs open in a separate browser window.

Instead of HTML markup in one field, you could have plain text in the Description field with the instruction to click the link contained in your custom URL-typed field.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!