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.

  • Now i have found the solution below i have given it. – Arun Sep 30 '13 at 10:01
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.

  • 2
    mark your solution as "answered" :) – Scott Pelak Sep 30 '13 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.