Newer Version Available

This content describes an older version of this product. View Latest

UserCriteria

Represents the member criteria to use in community moderation rules. This type extends the Metadata metadata type and inherits its fullName field..

File Suffix and Directory Location

UserCriteria components have the suffix community_name.user_criteria_developer_name.userCriteria and are stored in the UserCriteria folder.

Version

UserCriteria components are available in API version 39.0 and later.

Special Access Rules

To view, create, edit, and delete moderation rules, you need the Manage Communities or Create and Set Up Communities permission.

Fields

Field Name Field Type Description
creationAgeInSeconds int If specified, includes only users that were created within a specific time frame.
description string The description of the user criteria.
lastChatterActivityAgeInSeconds int If specified, includes only members that have posted or commented in the community within a specific time frame.
masterLabel string Name of the user criteria.
userTypes NetworkUserType (enumeration of type string) The member type to use in moderation rules. Valid values are:
  • Internal
  • Customer
  • Partner

Declarative Metadata Sample Definition

The following is an example of a UserCriteria component.

1<?xml version="1.0" encoding="UTF-8"?>
2<UserCriteria xmlns="http://soap.sforce.com/2006/04/metadata">
3    <masterLabel>Customer and Partner Members</masterLabel>
4    <description>Member criteria matches customer and partner member</description>
5    <userTypes>Partner</userTypes>
6    <userTypes>Customer</userTypes>
7</UserCriteria>