Kulbhushan Singh
Kulbhushan Singh

Reputation: 536

How to enable rating/like settings while creating custom list declaratively in SharePoint 2013

I am creating Custom List Definition and List Instances for SharePoint 2013 declaratively using CAML. How can I enable the Like/Ratings settings activated by default for all my List Instances.

Ofcourse, one way is to activate from "Rating Settings" from List Settings page of the list, this is not what needed. Thanks

Upvotes: 0

Views: 805

Answers (1)

Viaceslavas Ruckis
Viaceslavas Ruckis

Reputation: 36

In order for SharePoint to make rating available for your content you need to add rating fields to your list definition.

<FieldRef ID="{5a14d1ab-1513-48c7-97b3-657a5ba6c742}" Name="AverageRating" />
<FieldRef ID="{b1996002-9167-45e5-a4df-b2c41c6723c7}" Name="RatingCount" />

Information is taken from this blog post by Wictor Wilen. It is for SharePoint 2010 but the mechanics are the same. Adding the fields that are required by functionality should be enough to enable the functionality for the list

Upvotes: 1

Related Questions