Le réseau pour les développeurs > Forums - Accueil > SharePoint - Workflow > How to keep an item approved after a change?
Poser une questionPoser une question
 

TraitéeHow to keep an item approved after a change?

  • vendredi 3 juillet 2009 04:51theluckychicken Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     

    G'day,

    I'm having trouble with an approval workflow. There may be a better way to do this, and I'm after some advice. Here is my scenario;

    The workflow is a Application for Leave request, where staff fill out information in a list regarding their leave. The workflow sends an email to the manager, who approves. After it is approved, the list then asks the Finance department to add further information (like date entered into Payroll, etc). One the finance person does this, the list item's Approval Status reverts to being Pending. Is there a way of keping the item approved always, after it has been initially approved?

    • ModifiéMike Walsh MVPMVP, Modérateurvendredi 3 juillet 2009 07:04Scenario: Prefix removed from Title (I don't like meaningless prefixes). Title made into a question
    •  

Réponses

  • vendredi 3 juillet 2009 07:03Serge Luca [MVP]MVPMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     Traitée
    Is this a VS workflow or a Sharepoint Designer workflow ? obviously the approval process is based on the Out of the Box (OOB) List Content Approval;
    2 options :
    • you deactivate the OOB approval and the workflow use its own approval status (set an approval column to true or false)
    • you keep it and by code you auto-approve   with the following code :

    item.ModerationInformation.Status = SPModerationStatusType.Approved;

    (item is  SPListItem).


    Serge Luca; blog: http://www.redwood.be

Toutes les réponses

  • vendredi 3 juillet 2009 07:03Serge Luca [MVP]MVPMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     Traitée
    Is this a VS workflow or a Sharepoint Designer workflow ? obviously the approval process is based on the Out of the Box (OOB) List Content Approval;
    2 options :
    • you deactivate the OOB approval and the workflow use its own approval status (set an approval column to true or false)
    • you keep it and by code you auto-approve   with the following code :

    item.ModerationInformation.Status = SPModerationStatusType.Approved;

    (item is  SPListItem).


    Serge Luca; blog: http://www.redwood.be
  • vendredi 3 juillet 2009 07:14theluckychicken Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    Thanks Serge,

    It is a SP Designer Workflow.

    Your first point is probably going to be my solution, however won't I lose the ability to but a reason if it is rejected?

  • vendredi 3 juillet 2009 07:17Serge Luca [MVP]MVPMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    to keep it simple you can just add a new new column for a description/justification...
    Serge Luca; blog: http://www.redwood.be