I have a publishing web with unique permissions. I have tried changing the default approvers group through code by doing the follwing:

  1. Locate Pages list
  2. Locate workflow association by list.DefaultContentApprovalWorkflowId
  3. Update AssociationData and change DisplayName and AccountId to "CustomApprovers" (which is a sharepoint group.
  4. 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.

1 Answer 1


The reason it did not work was because I was manipulating the AssociationData using XDocument. When I dumped the xml back into the string it attached

<?xml version="1.0" encoding="utf-16">

at the top which in turn caused the xml to be rejected in some weird way. Doing a regular string replace worked just fine.

  • Also doing XDocument.ToString() would work as it does not write the <xml> declaration.
    – Thomas
    Oct 24, 2012 at 8:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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