Skip to main content
Hi,

 

I have a problem with my query in my VisualForce Page.

 

This query is : clients= [SELECT IdClient__c, Name, Cancelled__c,  Note__c, Type_Client__c, Pays__c FROM Clients__c  order by Name LIMIT 15];   

 

She returns for Pays__c the value in the column Pays. So it's not the value which is waiting... i want have "France" or "Spain"

 

SOQL -  Joint Problem

 

I have try this query : [SELECT IdClient__c, Name, Cancelled__c,  Note__c, Type_Client__c, Pays__c, ( SELECT Pays__c.Name FROM Pays__r) FROM Clients__c  order by Name LIMIT 15]; 

 

but this query send me an error.

 

_img alt="Error" src="

https://na11.salesforce.com/img/approvals/stopsign_16x16.gif

" /_

Error: Erreur de compilation : Didn't understand relationship 'Pays__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. à la ligne 16 colonne 18

I don't understand.

 

I have an object Pays and an object Clients and i want have the good value for Pays in my table and not a0AG000000Aw09KMAR.

 

Can you help me ? 

 

Thanks for your answers ,

 

Marion
10 answers
  1. Mar 20, 2013, 9:43 AM
    Ah! My bad!

     

    "pays" is a field on client object!

     

    ok then query like this,

     

    [SELECT IdClient__c, Name, Cancelled__c,  Note__c, Type_Client__c, Pays__r.Name FROM Clients__c  order by Name LIMIT 15];

     

    Pays__r.Name should give you the name and not the Id! :)
0/9000