Filter multi select list based on another list

Hi,

I’ve got a project object with two properties: “project team” and “project lead”. Both properties are from an “employee” list.

I would like to filter the selection for the “project lead” list to only show people already chosen as members of the project team. I tried “filtering based on another property”, but this didn’t achieve the expected outcome. Is there anyway to filter a list more dynamically (specifically telling it HOW to filter from a different property)?

 Cheers,

matt 

Parents
  • Bump for this one - any advice on how to filter more dynamically to have a property that must be chosen from the values in another property? I can manage some automatic property validation to create an error, but fixing the filter would be cleaner.

  • I ended up implementing this as a validation on the "project lead" property, so although it won't filter it will throw an error if the project lead isn't found in the project team.

    Option Explicit
    
    Dim oPropVals : Set oPropVals = Vault.ObjectPropertyOperations.GetProperties (ObjVer,False)
    
    Dim lead, member, leads, projectTeam, match
    
    ' get all members of project team
    Set projectTeam = oPropVals.SearchForProperty(1185).TypedValue.GetValueAsLookups()
    
    Set leads = PropertyValue.TypedValue.GetValueAsLookups()
    
    ' check whether each lead is a member of the project team
    For Each lead in leads
    	match = false
    	For Each member in projectTeam
    		if member.DisplayValue = lead.DisplayValue then
    			match = true
    			Exit For
    		end if
    	Next
    
    	if not match then
    		Err.Raise MFScriptCancel, "All technical leads must be members of the project team, please either add " + lead.DisplayValue + " to the project team or remove them as a technical lead."
    	End If
    Next

Reply
  • I ended up implementing this as a validation on the "project lead" property, so although it won't filter it will throw an error if the project lead isn't found in the project team.

    Option Explicit
    
    Dim oPropVals : Set oPropVals = Vault.ObjectPropertyOperations.GetProperties (ObjVer,False)
    
    Dim lead, member, leads, projectTeam, match
    
    ' get all members of project team
    Set projectTeam = oPropVals.SearchForProperty(1185).TypedValue.GetValueAsLookups()
    
    Set leads = PropertyValue.TypedValue.GetValueAsLookups()
    
    ' check whether each lead is a member of the project team
    For Each lead in leads
    	match = false
    	For Each member in projectTeam
    		if member.DisplayValue = lead.DisplayValue then
    			match = true
    			Exit For
    		end if
    	Next
    
    	if not match then
    		Err.Raise MFScriptCancel, "All technical leads must be members of the project team, please either add " + lead.DisplayValue + " to the project team or remove them as a technical lead."
    	End If
    Next

Children
No Data