Re: Assigning values to a Multi-Select PickList

  •  05-22-2007, 1:56 PM

    Re: Assigning values to a Multi-Select PickList

    In looking at the database and how MultiSelect data is stored, I attempted to set the CustomFieldValue.Value to the XML structure that I found there, and it worked great.  Below is the function that I call for the value of the customValues() argument of the IncidentHandler.AddIncident method.

    Hope this helps someone out there, Cheers! 

    Protected Function GetCustomFieldValues() As IncidentService.CustomFieldValue()
        Dim handler As IncidentService.IncidentHandler = New IncidentService.IncidentHandler()
        Dim customValue As IncidentService.CustomFieldValue
        Dim returnValue() As IncidentService.CustomFieldValue
        Dim areas As String = GetSupportAreas() 'returns a comma-space delimited list of selected Support Areas
    
    '1. populate with an array of all the custom fields
        returnValue = handler.GetCustomFieldValuesList( SecurityToken() )
    
    '2. loop and fill
        For Each customValue In returnValue
    
            Select Case customValue.CustomField.FieldLabel
            '_________________________'
                Case "Support Area"
            '¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯'
                    If areas.Length = 0 Then
                        customValue.Value = "<MultiSelect />"
                    Else
                        customValue.Value = "<MultiSelect><Value>" + areas.Replace(", ", "</Value><Value>") + "</Value></MultiSelect>"
                    End If
            '_________________________'
                Case "Workstation"
            '¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯'
                customValue.Value = GetWorkstation()
            End Select
    
        Next
    
    '3. return the filled in custom fields
        Return returnValue
    
    EndFunction
    
    Filed under: ,
View Complete Thread

© 2002 - 2007, Axosoft, LLC. All Rights Reserved. | Privacy
Bug Tracking | Defect Tracking Videos | Help Desk Software