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
Jyoti TrailheadJyoti Trailhead 

Display tr in VF page based on User location

I have below code but it is not working - it is showing table row even if Location is not matching...... it displays Location value correctly:

<tr  style="{IF({!$User.Office_Location__c} = 'XXXX'),'display: table-row;,none;'}">
    <td class="button" width="38em" height="69">
      <div>
     <apex:image style="float:left; margin:1; width:44px; height:45px;"  value="{!URLFOR($Resource.ViewKA1)}"/>
      <apex:outputLink target="_blank"  value="https://www.salesforce.com" id="HRChatbot">HR Chatbot</apex:outputLink>
         </div>
    </td>
  </tr>
Best Answer chosen by Jyoti Trailhead
Jyoti TrailheadJyoti Trailhead
It worked with rendering region in output panel - 

<apex:outputPanel rendered="{!ISPICKVAL($User.Region__c,'North America')}">

All Answers

Raj VakatiRaj Vakati
Try like this
 
<tr  style="{IF(!$User.Office_Location__c == 'XXXX'),'display: table-row;,none;'}">

complete code
 
<tr  style="{IF(!$User.Office_Location__c == 'XXXX'),'display: table-row;,none;'}">
    <td class="button" width="38em" height="69">
      <div>
     <apex:image style="float:left; margin:1; width:44px; height:45px;"  value="{!URLFOR($Resource.ViewKA1)}"/>
      <apex:outputLink target="_blank"  value="https://www.salesforce.com" id="HRChatbot">HR Chatbot</apex:outputLink>
         </div>
    </td>
  </tr>

​​​​​​​
Jyoti TrailheadJyoti Trailhead
Hi Raj 

It didnt work - it is never checking If condition and showing table row for all users.

Regards
jyoti
 
Jyoti TrailheadJyoti Trailhead
It worked with rendering region in output panel - 

<apex:outputPanel rendered="{!ISPICKVAL($User.Region__c,'North America')}">
This was selected as the best answer