Newer Version Available

This content describes an older version of this product. View Latest

setActionFieldValues

Allows custom components to select a quick action on a record page and then specify field values for that action.

Because this method also selects the quick action, you don't need to use the selectAction method. To submit the quick action updates, pass submitOnSuccess as true.

Arguments

Name Type Description
actionName string The name of the quick action that you want to access.
parentFields Object Optional. The fields that you want to update on the current record. For example, if you want to set field values on the Email quick action on the case record page, the case object is the parent record.
targetFields Object The fields that you want to update on the quick action.
submitOnSuccess boolean Optional. Set to true if you want to save and submit the quick action after setting the field values. Default is false.

The actionName parameter starts with the Salesforce object, followed by the quick action name. For example:

1actionName: "Case.UpdateCase"

The parentFields and targetFields objects contain a list of field names with values for each field. Each field can optionally specify the insertion behavior using the insertType key, which can be replace (default), cursor, or begin. For example:

1var parentFields = { Status: {value: "Closed"}, 
2                     Subject: {value: "Case subject", insertType: "cursor"} }
3var targetFields = { ToAddress: {value: "to@to.com"}, 
4                     TextBody: {value: "the text body", insertType: "cursor"} }

We recommend that you don’t use this API with the following items:

  • Read-only fields
  • Encrypted fields
  • Fields within social actions

Response

Returns a Promise. Success resolves to a response object. The Promise is rejected on error response.

1success: boolean,
2actionName: "LogACall",
3unavailableAction: boolean,
4targetFieldErrors: [{
5  Status: {message: "error"},
6  Subject: {message: "error",
7}],
8errors: []