3

I have Detail table with the lookup relation table (Status). I'm able to take the records from the detail table, but i do not know how to take the value from status table.

Below i have given the query

Lookup Table :: Status_c

It's Column :: Status_name__c & Status_Code__c

from the below selection how to take the Status_name__c & Status_Code__c column values from Status_c table.

QUERY

SELECT Width__c, Status__c 
FROM Detail__c detail 
WHERE detail.Status__r.Status_Code__c = 'B' 
AND detail.Packaging_Id__c = : Id

Kindly help me. In case any further information please let me know.

1
  • Now i have found the solution below i have given it.
    – Arun
    Commented Sep 30, 2013 at 10:01

1 Answer 1

4

Finally found the way below here i have the query.

QUERY:

SELECT Width__c, Status__r.Status_Code__c 
FROM Detail__c detail 
WHERE detail.Status__r.Status_Code__c = 'B' 
AND detail.Packaging_Id__c = : Id

Before, I used Status__c.Status_Code__c, and I got an exception. Now, I have rectified it with Status__r.Status_Code__c.

1
  • 2
    mark your solution as "answered" :) Commented Sep 30, 2013 at 16:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .