Compartilhar via


RelatedField classe

Especifica uma relação para um campo de pesquisa

Inheritance hierarchy

System.Object
  Microsoft.SharePoint.Client.ClientObject
    Microsoft.SharePoint.Client.RelatedField

Namespace:  Microsoft.SharePoint.Client
Assemblies:   Microsoft.SharePoint.Client.Silverlight (em Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client.Phone (em Microsoft.SharePoint.Client.Phone.dll)  Microsoft.SharePoint.Client (em Microsoft.SharePoint.Client.dll)

Sintaxe

'Declaração
Public Class RelatedField _
    Inherits ClientObject
'Uso
Dim instance As RelatedField
public class RelatedField : ClientObject

Exemplos

Este exemplo de código exibe o identificador de campos relacionados à lista de tarefas do site especificado.

using System;
using Microsoft.SharePoint.Client;

namespace Microsoft.SDK.SharePointFoundation.Samples
{
    class RelatedFieldExample
    {
        static void Main()
        {
            string siteUrl = "http://MyServer/sites/MySiteCollection";

            ClientContext clientContext = new ClientContext(siteUrl);
            Web site = clientContext.Web;

            List targetList = site.Lists.GetByTitle("Tasks");

            // Get a collection of lookup fields that use this list as a data source 
            // and that have FieldLookup.IsRelationship set to true.
            RelatedFieldCollection collRelatedField = targetList.GetRelatedFields();

            clientContext.Load(collRelatedField);
            clientContext.ExecuteQuery();

            foreach (RelatedField relField in collRelatedField)
               Console.WriteLine("Related Field ID: {0}", relField.FieldId);
        }
    }
}

Segurança de thread

Os membros públicos estática (Shared no Visual Basic) desse tipo são seguros para thread. Nenhum membro de instância pode ser garantido como seguro para thread.

Ver também

Referência

RelatedField membros

Microsoft.SharePoint.Client namespace