Welcome to the Axosoft Community, Sign in | Register | Help
in Search

Assigning values to a Multi-Select PickList

Last post 05-22-2007, 1:56 PM by Dennis Allen. 1 replies.
Sort Posts: Previous Next
  •  05-22-2007, 12:30 PM 11754

    Assigning values to a Multi-Select PickList

    Greetings,

    I am creating an Incident Reporting web page using the 2007 SDK, and I need to figure out how to assign to a custom field that is a multi-select pick list.  I have found how to read in the choices for the list, but not how to set the selected values in the CustomFieldValues.

    Any help or advice would be greatly appreciated!

    Dennis D. Allen
     

  •  05-22-2007, 1:56 PM 11755 in reply to 11754

    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 as RSS news feed in XML

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