NextBestAction Class
Namespace
Usage
Community users can't access this class. Portal and guest users can access strategies only through the Suggested Actions component.
NextBestAction Methods
deleteRecommendationReaction(reactionId)
API Version
45.0
Requires Chatter
No
Signature
public static Void deleteRecommendationReaction(String reactionId)
Parameters
- reactionId
- Type: String
- ID of the recommendation reaction or other sObject that caused the user to react.
Return Value
Type: Void
executeStrategy(strategyName, maxResults, contextRecordId)
API Version
45.0
Available to Guest Users
45.0
Requires Chatter
No
Signature
public static ConnectApi.NBARecommendations executeStrategy(String strategyName, Integer maxResults, String contextRecordId)
Parameters
Return Value
executeStrategy(strategyName, maxResults, contextRecordId, debugTrace)
API Version
45.0
Available to Guest Users
45.0
Requires Chatter
No
Signature
public static ConnectApi.NBARecommendations executeStrategy(String strategyName, Integer maxResults, String contextRecordId, Boolean debugTrace)
Parameters
- strategyName
- Type: String
- Name of the strategy.
- maxResults
- Type: Integer
- Maximum number of results. Valid values are from 1 to 25. The default is 3.
- contextRecordId
- Type: String
- ID of the context record. For example, if the next best action is on a case detail page, the ID of the case.
- debugTrace
- Type: Boolean
- Specifies whether to return trace and debug information in the response (true) or not (false).
Return Value
executeStrategy(strategyName, strategyInput)
API Version
45.0
Available to Guest Users
45.0
Requires Chatter
No
Signature
public static ConnectApi.NBARecommendations executeStrategy(String strategyName, ConnectApi.NBAStrategyInput strategyInput)
Parameters
- strategyName
- Type: String
- Name of the strategy.
- strategyInput
- Type: ConnectApi.NBAStrategyInput
- A ConnectApi.NBAStrategyInput body.
Return Value
getRecommendation(recommendationId)
API Version
45.0
Requires Chatter
No
Signature
public static ConnectApi.Recommendation getRecommendation(String recommendationId)
Parameters
- recommendationId
- Type: String
- ID of the recommendation.
Return Value
getRecommendationReaction(reactionId)
API Version
45.0
Requires Chatter
No
Signature
public static ConnectApi.RecommendationReaction getRecommendationReaction(String reactionId)
Parameters
- reactionId
- Type: String
- ID of the recommendation reaction or other sObject that caused the user to react.
Return Value
Usage
getRecommendationReactions(onBehalfOfId, createdById, targetId, contextRecordId, pageParam, pageSize)
API Version
45.0
Requires Chatter
No
Signature
public static ConnectApi.RecommendationReactions getRecommendationReactions(String onBehalfOfId, String createdById, String targetId, String contextRecordId, Integer pageParam, Integer pageSize)
Parameters
- onBehalfOfId
- Type: String
- Use the ID of the user who is indirectly reacting to the recommendation to filter the results.
- createdById
- Type: String
- Use the ID of the user or record that created the recommendation reaction to filter the results.
- targetId
- Type: String
- Use the ID of the target to filter the results.
- contextRecordId
- Type: String
- Use the ID of a context record to filter the results.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
setRecommendationReaction(reaction)
API Version
45.0
Available to Guest Users
48.0
Requires Chatter
No
Signature
public static ConnectApi.RecommendationReaction setRecommendationReaction(ConnectApi.RecommendationReactionInput reaction)
Parameters
- reaction
- Type: ConnectApi.RecommendationReactionInput
- A ConnectApi.RecommendationReactionInput object representing a reaction to a recommendation produced by a recommendation strategy.