TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Carlos Santos
NA
14
2.4k
get internal status workflows
Jun 19 2017 7:01 AM
Hi, im trying to get the internal status from all workflows in a sharepoint site. I asked this here:
https://sharepoint.stackexchange.com/questions/217585/get-workflow-status-sharepoint-2013/217591#217591
but the answer did not help me. I dont understand why I get always 0 Workflows if I have workflows running. I created a list, added the workflows. They start automatically when I create a new item. The workflow is showed with a column "wflow" ( so the name my workflow ). But when I use the code above or other snippets with a SPWorkflowManager I always get 0 workflows... Any ideas? Thanks in advance.
foreach
(SPWorkflow workflow
in
manager.GetItemWorkflows(item))
{
if
(workflow.ParentAssociation.Name ==
"wflow"
)
{
foreach
(SPField field
in
workflow.ParentList.Fields)
{
if
(field
is
SPFieldWorkflowStatus)
{
SPFieldWorkflowStatus statusField = (SPFieldWorkflowStatus)field;
if
(statusField.Title ==
"wflow"
)
{
int
statusValue =
int
.Parse(item[statusField.StaticName].ToString());
// display the status however you want
System.Diagnostics.Debug.WriteLine(statusField.GetFieldValueAsHtml(statusValue).ToString());
}
}
}
}
}
Reply
Answers (
4
)
Create Sign-In with SharePoint to list from the JavaScript?
What is SharePoint Hosted apps?