Share via


SPFieldWorkflowStatus.FieldValueType property

Gets the type of the field value.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Overrides ReadOnly Property FieldValueType As Type
    Get
'Usage
Dim instance As SPFieldWorkflowStatus
Dim value As Type

value = instance.FieldValueType
public override Type FieldValueType { get; }

Property value

Type: System.Type
An object that represents the type Int32.

Remarks

You can use the FieldValueType property to get the type of the value for a field that has been cast as type SPFieldWorkflowStatus. In this case, the FieldValueType property returns Int32.

Examples

The following example is a console application that prints the string representation of the value of the FieldValueType property.

The application assumes that the Web site has a list named "Test List" and that the list has at least one workflow association.

Imports System
Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.Workflow

Module ConsoleApp
   Sub Main()
      Using site As SPSite = New SPSite("https://localhost")
         Using web As SPWeb = site.OpenWeb()

            Dim listName As String = "Test List"

            Dim list As SPList = web.Lists(listName)
            Dim association As SPWorkflowAssociation = list.WorkflowAssociations(0)

            Dim statusField As SPFieldWorkflowStatus = _
                CType(list.Fields.GetField(association.Name), SPFieldWorkflowStatus)

            Console.WriteLine(statusField.FieldValueType.ToString())

         End Using
      End Using
      Console.Write(vbCrLf + "Press ENTER to continue...")
      Console.ReadLine()
   End Sub
End Module
using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Workflow;

namespace Test
{
   class ConsoleApp
   {
      static void Main(string[] args)
      {
         using (SPSite site = new SPSite("https://localhost"))
         {
            using (SPWeb web = site.OpenWeb())
            {
               string listName = "Test List";

               SPList list = web.Lists[listName];
               SPWorkflowAssociation association = list.WorkflowAssociations[0];

               SPFieldWorkflowStatus statusField = 
                  list.Fields.GetField(association.Name) as SPFieldWorkflowStatus;

               Console.WriteLine(statusField.FieldValueType.ToString());
            }
         }
         Console.Write("\nPress ENTER to continue...");
         Console.ReadLine();
      }
   }
}

See also

Reference

SPFieldWorkflowStatus class

SPFieldWorkflowStatus members

Microsoft.SharePoint namespace