Salesforce and Application Integration > Controlling Who Sees Guides > Filtering Using Tags
  

Filtering Using Tags

When you define a guide's properties, you specify the object to which the guide applies and all users who have access to the object can see the related guides.
You can set conditions under which guides appear by Using the Tags area on the Guide Properties dialog. For example, if you might want to display a certain guide only for leads with an "Open - Not Contacted" status. In this case, you first create a tag for the guide that is used as a display filter. In addition to the built-in capability filters for some object fields, you can then customize guides to apply these tags.
Note: You can also simply set Guide Properties to determine where guides display. For details, see Show Guide Only When.
To filter from the Visualforce page, use this approach:
  1. 1From the Salesforce Setup menu, select App Setup > Develop > Pages.
  2. 2Select the Visualforce Markup tab:
  3. 3
  4. 4Add a filter to this page to create a tag, using the guidelines below. For example, a guide could filter by account types, account industries, or user roles.
Guidelines
Suppose you want users with different roles to see and be able run different sets of guides for Opportunities. To do so, simply create a tag like Role=CEO on your guide. Since the Opportunity object type is already set up to filter based on role, this guide will now only appear if the user's role is CEO.
The equals sign (=) determines how the guide use the tag's contents for matching. The guide will be displayed only if the object matches all of the guide's tags.
Notice this condition in the Visualforce page definition:
match="Role={!JSENCODE(SUBSTITUTE($UserRole.Name, ",", ""))}
When the Opportunity page loads, because $UserRole.Name is a match (in this case,match="Role=CEO", the guide displays. (You can ignore the JSENCODE and SUBSTITUTE functions.)
If a guide does not have a tag with an equal sign, it is always shown, you can define match criteria to excludes a specific value, or hide a guide by setting a match definition will never occur, for example, Role=foo.
In the Account page definition (AeAccountSalesGuide), there are three possible matches. Using the same kind of logic, you could create a guide that matches on any of the fields that are on the page:
<apex:page standardController="Account">
<c:AeSalesGuides objectType="Account" bjectId="{!Account.Id}"
extraInfo="{!JSENCODE(Account.Name)}"
match="Role={!JSENCODE(SUBSTITUTE($UserRole.Name, ",", ""))},
Type={!JSENCODE(SUBSTITUTE(Account.Type, ",", ""))},
Industry={!JSENCODE(SUBSTITUTE(Account.Industry, ",", ""))}"/>
</apex:page>