RE: Permissions error on power Automate for originator of document
I hadn't been using PA to do approvals but recently got the same error and figured out what was wrong. It is a fairly silly solution but it for sure works. The user you have defined on the BC connector needs to be in the approval user setup page of BC either as an approver to any user or as a substitute to any user. If all that is true then it works like a charm.
It's all down to this procedure that is called from the workflow webhook management codeunit. Part at the bottom is where the work around comes into play.
local procedure CanAct(WorkflowWebhookEntry: Record "Workflow Webhook Entry"): Boolean
var
UserSetup: Record "User Setup";
WorkflowStepArgument: Record "Workflow Step Argument";
begin
if WorkflowWebhookEntry.Response <> WorkflowWebhookEntry.Response::Pending then
exit(false);
if IsNullGuid(WorkflowWebhookEntry."Response Argument") then
exit(false);
if not WorkflowStepArgument.Get(WorkflowWebhookEntry."Response Argument") then
exit(false);
case WorkflowStepArgument."Response Type" of
WorkflowStepArgument."Response Type"::"User ID":
begin
if WorkflowStepArgument."Response User ID" <> UserId then
exit(false);
UserSetup.Init();
UserSetup.FilterGroup(-1);
UserSetup.SetFilter("Approver ID", '%1', UserId);
UserSetup.SetFilter(Substitute, '%1', UserId);
exit(UserSetup.FindFirst)
end