You need to sign in to do that
Don't have an account?

Need help in select query
Hi ,
Iam trying query all the engagement products except except one product with name contains 'Exclude Producr'
lstEngageProduct = [Select Id, CurrencyIsoCode, Name, FTE__c,Available_FTE_s__c, Product__r.Name, Quantity__c, Total_Price__c, Engagement__c from Engagement_Product__c where Engagement__c =: ApexPages.currentPage().getParameters().get('Id') AND NOT((Product__r.Name).contains('Exclude Producr')) ];
But iam getting error ,Can some one help me on this to exclude the product.
Thanks
Lokesh
Iam trying query all the engagement products except except one product with name contains 'Exclude Producr'
lstEngageProduct = [Select Id, CurrencyIsoCode, Name, FTE__c,Available_FTE_s__c, Product__r.Name, Quantity__c, Total_Price__c, Engagement__c from Engagement_Product__c where Engagement__c =: ApexPages.currentPage().getParameters().get('Id') AND NOT((Product__r.Name).contains('Exclude Producr')) ];
But iam getting error ,Can some one help me on this to exclude the product.
Thanks
Lokesh
NOT((Product__r.Name).contains('Exclude Producr'))
since Product__r is a related list.
I think you can use the "LIKE" operator with NOT logic in SOQL query:
...... AND (NOT Product__r.Name LIKE '%Exclude Producr%') ....
Try and let me know