• Yassine Zouag
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Hello, 

In my test class, I want the user to be able to display contact data (name, phone, etc, which will be shown in a table), even for contacts to which he has no access. Of course, he wouldn't be able to access the page record (since he doesn't hava read permission.

However, when my query is run as the user, no contacts are shown.
Select Id, Name, Phone from Contact;

Do you know a workaround ?
Thanks.
 
Hello,

In my VisualForce page, in order to be able to search by name or phone, I used selectRadio tag to only dispaly the name field or the phone field using : "rendered="{!searchBy=='phone'}" for example.
<apex:selectRadio value="{!searchBy}" id="searchBy" onclick="searchByClick();"> 
<apex:selectOption itemValue="name" itemLabel="Search by Name" /> 
<apex:selectOption itemValue="phone" itemLabel="Search by Phone" /> 
​</apex:selectRadio>
In the test method, how to simulate click on the radio button ?

I tried : 
myVisualForceController.getParameters().put('searchBy','phone');
But it doesn't work.
Any ideas ?
Thanks
Hello,
I want to use a global variable ($Site.Prefix) in an APEX controller class, inside a condition to determine which subdomain i'm using.
For example : 
urlPath = {!$Site.Prefix};
However, I'm getting : 
Error: Compile Error: unexpected token: '{' at line ...

Since I cannot use APEX tags in my APEX class, do you know any workaround ?

Thanks.
Hello, 

In my test class, I want the user to be able to display contact data (name, phone, etc, which will be shown in a table), even for contacts to which he has no access. Of course, he wouldn't be able to access the page record (since he doesn't hava read permission.

However, when my query is run as the user, no contacts are shown.
Select Id, Name, Phone from Contact;

Do you know a workaround ?
Thanks.