I have a publishing web with unique permissions. I have tried changing the default approvers group through code by doing the follwing:
- Locate Pages list
- Locate workflow association by list.DefaultContentApprovalWorkflowId
- Update AssociationData and change DisplayName and AccountId to "CustomApprovers" (which is a sharepoint group.
- Call list.WorkflowAssociations.Update with the association.
It seems to work fine until I try to submit a page for approval. Sharepoint shows the "Processing" page, but when it completes the page is always discarded. It also does not add a task to the approval task list. Why does this happen? Am I missing a step?
Things I've tried:
- Change it to a group that does not exist: Validation error when submitting.
- Change AccountId to the group id: Validation error when submitting.
- Change the AccountType to SpGroup: Page is automatically discarded.
- Not change anything (use default settings): Page is submitted correctly.