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
Sandy1Sandy1 

Im unable to use queried field in where condtion

How to resolve 
Select Id ,name,(Select Product_dashcode__c from IX_V1__PP_Relationships__r)from IX_V1__ICIX_Product__c
                                                             Where Name 
                                                             LIKE:newSearchText 
                                                             OR Product_dashcode__c=:productName 

It showing 


                           OR Product_dashcode__c=:productName
                              ^
ERROR at Row:5:Column:65
No such column 'Product_dashcode__c' on entity 'IX_V1__ICIX_Product__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
Best Answer chosen by Sandy1
Niraj Kr SinghNiraj Kr Singh
Hi Sandy,

According to your query, it seems "Product_dashcode__c" is a field of IX_V1__PP_Relationship__c object. Where as you are trying to use it in Where condition of another object IX_V1__ICIX_Product__c.

Mightbe it will be like that:


[Select Id ,name,(Select Product_dashcode__c from IX_V1__PP_Relationships__r WHERE Product_dashcode__c=:productName ) from IX_V1__ICIX_Product__c Where Name  LIKE:newSearchText ]
                                                           
Thanks
Niraj