Answers Class

Represents zone answers.

System

Answers is a feature that enables users to ask questions and have zone members post replies. Members can then vote on the helpfulness of each reply, and the person who asked the question can mark one reply as the best answer.

For more information on answers, see “Answers Overview” in the Salesforce online help.

The following example finds questions in an internal zone that have similar titles as a new question:

The following example marks a reply as the best reply:

The following are methods for Answers. All methods are static.

  • findSimilar(yourQuestion)

    Returns a list of similar questions based on the title of the specified question.

  • setBestReply(questionId, replyId)

    Sets the specified reply for the specified question as the best reply. Because a question can have multiple replies, setting the best reply helps users quickly identify the reply that contains the most helpful information.

Returns a list of similar questions based on the title of the specified question.

public static ID[] findSimilar(Question yourQuestion)

  • yourQuestion:

    Type: Question

Type: ID[]

Each findSimilar call counts against the SOSL statements governor limit allowed for the process.

Sets the specified reply for the specified question as the best reply. Because a question can have multiple replies, setting the best reply helps users quickly identify the reply that contains the most helpful information.

public static Void setBestReply(String questionId, String replyId)

Type: Void