Compartilhar via


SPView.ProjectedFields Property

Gets or sets the ProjectedFields element XML of the view, which itemizes fields from joined foreign lists.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
<ClientCallableAttribute(Name := "ViewProjectedFields")> _
<ClientCallableConstraintAttribute(FixedId := "SPViewProjectedFields", Type := ClientCallableConstraintType.Custom,  _
    Value := "It MUST be null or be an XML fragment that conforms to ProjectedFieldsDefinition as specified in [MS-WSSCAML].")> _
Public Property ProjectedFields As String
    Get
    Set
'Usage
Dim instance As SPView
Dim value As String

value = instance.ProjectedFields

instance.ProjectedFields = value
[ClientCallableAttribute(Name = "ViewProjectedFields")]
[ClientCallableConstraintAttribute(FixedId = "SPViewProjectedFields", Type = ClientCallableConstraintType.Custom, 
    Value = "It MUST be null or be an XML fragment that conforms to ProjectedFieldsDefinition as specified in [MS-WSSCAML].")]
public string ProjectedFields { get; set; }

Property Value

Type: System.String
The ProjectedFields element XML.

Remarks

Each projected field is represented by a Field element. The maximum number of fields that can be included is defined as the difference between the maximum number of allowed fields in the primary list and the number of fields already in the primary list.

Examples

The following example shows how to add an additional field to the results returned by the query. The value of the List attribute is an alias to the foreign list. The alias is defined in a Join Element (View). The ShowField attribute must be set to the internal name of the foreign field. The Type is always ‘Lookup’.

<ProjectedFields>
  <Field
    Name=’CustomerCity’
    Type=’Lookup’
    List=’customerCities’
    ShowField=’Title’ />
</ProjectedFields>

See Also

Reference

SPView Class

SPView Members

Microsoft.SharePoint Namespace