Ask a questionAsk a question
 

AnswerChanging Workflow Status to a custom value

  • Wednesday, November 04, 2009 11:35 AMGinni Sharma Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I am trying to change the status of the workflow to "Approved" or "Rejected", once it is completed. I dont want to show the default status "Completed", when the workflow is over. But it is just showing me blank in the list.

    I added the following custom values in Workflow.xml file under <MetaData> section

    <ExtendedStatusColumnValues>
     <StatusColumnValue>Approved</StatusColumnValue>
     <StatusColumnValue>Rejected</StatusColumnValue>
    </ExtendedStatusColumnValues>

    Then i added the SetState activity in my Workflow Designer canvas and added the following code (based on approval and rejection condition)

    setstate1.State = (int)SPWorkflowStatus.Max;


    But the status field is just blank whenever the workflow is started. I am not getting which part i am missing.

Answers

  • Friday, November 06, 2009 10:42 AMGinni Sharma Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Thanks for the reply. Well i solved this. The only part i missed was that we need to do iisreset and again activate the feature, once you change Workflow.xml.

    Now it is working for me.
    • Marked As Answer byGinni Sharma Friday, November 06, 2009 10:42 AM
    •  

All Replies

  • Friday, November 06, 2009 7:10 AMGinni Sharma Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I noticed one more thing. Whenever i switch to DataSheet View then the value which it is showing under "Workflow Name" field is 15.

    It means that it is assigning the value to "State" property of the "Set State" activity but it not showing the content which i have written that is :

    <ExtendedStatusColumnValues>
     <StatusColumnValue>Approved</StatusColumnValue>
     <StatusColumnValue>Rejected</StatusColumnValue>
    </ExtendedStatusColumnValues>


    Rather it shows a blank field whenever i switch to other view.

    Can anybody help in this
  • Friday, November 06, 2009 9:42 AMJevgeni Borozna Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    Hello Ginni,

    Your first CustomStatus will be SPWorkflowStatus.Max + 1 and second SPWorkflowStatus.Max + 2
    Max returns Maximum of SharePoint internal status
  • Friday, November 06, 2009 10:42 AMGinni Sharma Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Thanks for the reply. Well i solved this. The only part i missed was that we need to do iisreset and again activate the feature, once you change Workflow.xml.

    Now it is working for me.
    • Marked As Answer byGinni Sharma Friday, November 06, 2009 10:42 AM
    •