function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kmorf_entransformkmorf_entransform 

error using <chatter:follow>

Im trying to use <apex:follow> but its giving this error that says "Cannot convert the value of '{!entityId}' to the expected type."

does anybody know what that means? 

 

my visualforce page looks likes this

<apex:page showHeader="false" docType="html-5.0" standardStylesheets="false" cache="false" controller="chatterController" >
<head>
      <meta charset="UTF-8" />
      
</head>
<body>
<chatter:follow entityId="{!Contacts}" id="chatterFollow"></chatter:follow>
</body>  
</apex:page>

 Here is my controller:

private List<Contact> contactName;
	private List<Id> contactIds = new List<Id>();
	
	public chatterController(){
		contactName = [Select Id From Contact Limit 2000];
		
		for (Contact names : contactName)
			contactIds.add(names.Id);
	}
	
	public List<Id> getContacts(){
		return contactIds;
	}

 

MoUsmanMoUsman

Hi kmorf_entransf…,

 

You can not pass list of ids in EntityId attribute https://ap1.salesforce.com/apexpages/apexcomponents.apexp 

 

<apex:page showHeader="false" docType="html-5.0" standardStylesheets="false" cache="false" controller="chatterController" >
<head>
      <meta charset="UTF-8" />
      
</head>
<body>
<chatter:follow entityId="{!Contacts[0]}" id="chatterFollow"></chatter:follow>
</body>  
</apex:page>

 If you want to get all follower for a particular contact then you can use

<apex:page showHeader="false" docType="html-5.0" standardStylesheets="false" cache="false" controller="chatterController" >
<head>
      <meta charset="UTF-8" />
      
</head>
<body>
<chatter:follower entityId="{!Contacts[0]}" id="chatterFollow"></chatter:follow>
</body>  
</apex:page>

If your issue resolved than mark as solved to help other

Note : Contacts[0] is a single contact.

--

Thanks

Usman