Maybe I'm just misunderstanding the capabilities of the Visualforce APIs
and the use of functions in VisualForce but I'd like to do something like this:
Looking at the Rendered
tag:
<apex:page ...>
<apex:pageBlockSectionItem rendered="{!$Utils.checkChatterEnabled}">
<apex:outputLabel for="enableChatterFeedTracking" value="Enable Chatter Feed Tracking" />
<apex:outputText value="Chatter Enabled" />
</apex:pageBlockSectionItem>
</apex:page>
And than I have a class with public
or global
visibility, that is NOT my controller or controller-extension:
global class Utils{
global static Boolean checkChatterEnabled(){
sObject feedEnabled = Database.query('SELECT Id FROM Meeting__Feed LIMIT 1');
if(feedEnabled != null){
return true;
} else {
return false;
}
}
}
Obviously this doesn't compile with a failure message:
Save error: Field $Utils.checkChatterEnabled does not exist
Is this possible? If so what am I doing wrong? If not, is their an "Idea" or "Success" article about it ...?
Thanks
Updated - to make checkChatterEnabled static.