1

I have created OOTB workflow using Approval - SharePoint 2010 (Globally Reusable workflow) in SharePoint Online. That can be triggered manually only. Now I want to disable manually start of workflow once it is completed i.e. I want users to trigger the workflow only once.

Is it possible to achieve ?

Thanks.

1

An idea is, creating a column as flag to check whether the workflow has been run on the current item before.

In the a Globally Reusable workflow, create a column as association column. Set the default value of this column to “No” (means the workflow has not been run yet).

At the beginning of the workflow, check whether the column value is “No”. If the column value equals to “No”, continue to run the approval steps. Otherwise, skip the approval.

At the end of the workflow, set the column value to “Yes” (means the workflow has been run).

If user wants to start the workflow again, the approval will not be run as the column value matches the value “Yes”.

Refer to:

https://social.technet.microsoft.com/Forums/windows/en-US/5261dbe3-f089-49b8-a5f9-4056579952b9/specify-a-workflow-to-only-run-once?forum=administration

Update:

Check the flag column value using JavaScript, if it matches the value, hide/disable the Start Workflow option.

For classic, we can use these web part. As you are using the modern view, you may need SPFx.

  • But I want to disable the option itself to trigger the workflow for approved documents. – Gopal Zadafiya Aug 8 '18 at 10:17
  • An idea, check the flag column value using JavaScript, if it matches the value, hide/disable the Start Workflow option. – JoannaW_MSFT Aug 8 '18 at 10:24
  • I have checked we are not able to add script editor/content editor web part on the same page – Gopal Zadafiya Aug 8 '18 at 10:39
  • you are using modern view, is it right? For classic, we can use these web part. For modern, you may need SPFx. – JoannaW_MSFT Aug 9 '18 at 4:58
  • you are correct, but we are not able to edit that page. so we can't add script to that page. so I am trying to add that script to masterpage – Gopal Zadafiya Aug 9 '18 at 5:18
0

It sounds like there will never be more than 1 version of documents, is that what is required? So users will never change a document after it has been approved once.

Perhaps you should try this instead: require check-in for documents and begin the approval workflow when the document is checked in. Change the workflow start conditions from allowing a 'manual start' to 'start on new item creation'. This way the workflow will also run only once. The approval workflow will run, the approver can approve or reject the document. I think this satisfies what you need.

0

You could use a workflow associated with a Content Type. Then on completion you could change the content type to one without the workflow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.