You need to sign in to do that
Don't have an account?
Lalith Bachimanchi
Record is being approved when actionType is Submit
Hi,
I have refered below link to submit a record for approval.
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_process_approvals_submit.htm
I am using REST API to submit a record for approval. When I submit a record, instead of submitting a record for approval, it is being approved.
Even though the approval process has two steps, when I make a REST call with non-admin to just submit a record, the response shows that record is approved. When I check in Salesforce UI, record is approved and Field Update and Email Alert has also fired.
Below is the request and Response:
POST https://instance//services/data/v44.0/process/approvals
json:
{
"requests" : [{
"actionType":"Submit",
"contextId":"a2k2D000000e03aQAA",
"comments":"submitted for approval 1 nov",
"processDefinitionNameOrId" : "US_Account_Approval_Process"}]
}
Response:
[
{
"actorIds": null,
"entityId": "a2k2D000000e03aQAA",
"errors": null,
"instanceId": "04g2D00000073vXQAQ",
"instanceStatus": "Approved",
"newWorkitemIds": [],
"success": true
}
]
Please let me know why it is behaving this way? Is it a defect in Salesforce API?
I have refered below link to submit a record for approval.
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_process_approvals_submit.htm
I am using REST API to submit a record for approval. When I submit a record, instead of submitting a record for approval, it is being approved.
Even though the approval process has two steps, when I make a REST call with non-admin to just submit a record, the response shows that record is approved. When I check in Salesforce UI, record is approved and Field Update and Email Alert has also fired.
Below is the request and Response:
POST https://instance//services/data/v44.0/process/approvals
json:
{
"requests" : [{
"actionType":"Submit",
"contextId":"a2k2D000000e03aQAA",
"comments":"submitted for approval 1 nov",
"processDefinitionNameOrId" : "US_Account_Approval_Process"}]
}
Response:
[
{
"actorIds": null,
"entityId": "a2k2D000000e03aQAA",
"errors": null,
"instanceId": "04g2D00000073vXQAQ",
"instanceStatus": "Approved",
"newWorkitemIds": [],
"success": true
}
]
Please let me know why it is behaving this way? Is it a defect in Salesforce API?