• salesVteams
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies

Hi,

 

I am trying to fetch child object field but its showing error "Invalid foreign key relationship: Book__c.brels__r" to me. Code i am using to fetch the filed is given below:

 

updatebook  = [select a.id, a.Name, a.Price__c,(SELECT b.Bookcolor__c FROM a.brels__r b) FROM Book__c a where id = :ApexPages.currentPage().getParameters().get('id')];//[select id, Name, Price__c from Book__C where id = :ApexPages.currentPage().getParameters().get('id')];
     name = updatebook.Name;
     price = updatebook.Price__c;
     color = updatebook.brels__r.Bookcolor__c;

 

Please help me if some one can do. Waiting for your eply.

 

 

Thanks

Hi,

I have a problem while using relational query. I have Created tow objects one is master "Book" and other is "Details" which is child of "Book" object.

I am trying to fetch data from both objects by using relational query but its not getting compliled successfully. Please if any one could help me regarding this issue. Here is my query and error message given below:

Query : [select id, Name, Price__c,(SELECT Color FROM Details__r) FROM Book__c ];

 

Error:Error: Compile Error: Didn't understand relationship 'Details__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. at line 20 column 18


Please guide me if someone can ...!

Thanks in Advance....

Hi,

 

I am trying to fetch child object field but its showing error "Invalid foreign key relationship: Book__c.brels__r" to me. Code i am using to fetch the filed is given below:

 

updatebook  = [select a.id, a.Name, a.Price__c,(SELECT b.Bookcolor__c FROM a.brels__r b) FROM Book__c a where id = :ApexPages.currentPage().getParameters().get('id')];//[select id, Name, Price__c from Book__C where id = :ApexPages.currentPage().getParameters().get('id')];
     name = updatebook.Name;
     price = updatebook.Price__c;
     color = updatebook.brels__r.Bookcolor__c;

 

Please help me if some one can do. Waiting for your eply.

 

 

Thanks

Hi,

I have a problem while using relational query. I have Created tow objects one is master "Book" and other is "Details" which is child of "Book" object.

I am trying to fetch data from both objects by using relational query but its not getting compliled successfully. Please if any one could help me regarding this issue. Here is my query and error message given below:

Query : [select id, Name, Price__c,(SELECT Color FROM Details__r) FROM Book__c ];

 

Error:Error: Compile Error: Didn't understand relationship 'Details__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. at line 20 column 18


Please guide me if someone can ...!

Thanks in Advance....