function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MDeveloperMDeveloper 

Master Details field in where condition

hi,

 

i am trying to use Master-Detail field in where condition like:

 

public List<ECS__eCommSource_Order_Line__c> getLineOrders(){
        
        string num = ApexPages.currentPage().getParameters().get('orderId');
        
        List<ECS__eCommSource_Order_Line__c> orders = [select  ECS__Product__c, ECS__Quantity__c, ECS__Tax__c,     ECS__Shipping__c, ECS__Order_Line_Total__c, ECS__Unit_Price__c from ECS__eCommSource_Order_Line__c WHERE ECS__Order__c = : num];

        return orders;
    }

 

ECS__Order__c is Master Details field in ECS__eCommSource_Order_Line__c object. i have number of records in this object but this query return empty record.

help me.

Rahul_sgRahul_sg
the query will return null if
string num = ApexPages.currentPage().getParameters().get('orderId'); is null
put a debug statement and check if " num "has any value.

how are you passing the orderId to this vf page