Home

FieldRef

FieldRef is a CAML (Collaborative Application Markup Language) element used in SharePoint to reference an existing field within a FieldRefs collection. It does not define or create a new field; instead, it declares that a given field should be included (and in a specific order) when describing content types, lists, views, or queries. FieldRefs are commonly found in XML definitions that specify how data is stored and displayed.

The FieldRef element identifies the target field either by its internal name or by its unique identifier

Usage scenarios include content type XML, where FieldRefs define the fields that belong to the content type

Notes and considerations: FieldRef does not create or modify fields; it only references existing ones. If a

(GUID).
Typical
forms
are:
<FieldRef
Name="Title"
/>
or
<FieldRef
ID="{GUID}"
/>.
It
is
generally
recommended
to
specify
only
one
identifying
attribute
(Name
or
ID).
The
internal
Name
corresponds
to
the
field’s
internal
name,
while
ID
uses
the
field’s
GUID.
Multiple
FieldRef
entries
can
be
used
to
control
the
sequence
of
fields
in
forms
and
views.
and
determine
their
order
in
associated
forms
and
displays,
as
well
as
in
list
views
and
CAML-based
queries
where
the
fields
to
be
retrieved
or
shown
are
listed.
For
example:
<FieldRefs><FieldRef
Name="Title"
/><FieldRef
ID="{GUID}"
/></FieldRefs>.
referenced
field
is
renamed,
deleted,
or
missing
in
the
target
environment,
the
FieldRef
may
become
invalid
and
rendering
or
data
retrieval
can
fail.
When
migrating
definitions
across
environments,
ensure
that
all
referenced
fields
exist
and
maintain
consistent
internal
names
and
GUIDs.
See
also
CAML,
ContentType,
Field,
List,
and
View.