Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

114
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda