You need to sign in to do that
Don't have an account?
Sukhdeep Singh
Not able to query on standard Asset field 'ProductCode' . Please suggest
List<Asset> lst= [select Id, ProductCode, Product_Family1__c, Product_Family__c from Asset WHERE AccountId = '0015000000IBGof' AND ( (NOT IB_Status__c Like '%eval%') OR (NOT IB_Status__c Like '%Under Right of Return%') OR (NOT IB_Status__c Like '%Sold - Demo%') OR (NOT IB_Status__c Like '%WRITTEN OFF%') ) AND Product_Family__c != 'Whitewater'];
I am getting below error
No such column 'ProductCode' on entity 'Asset'. 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.
Also I need to use group by (Product_Family1__c, Product_Family__c) this query But getting error
I am getting below error
No such column 'ProductCode' on entity 'Asset'. 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.
Also I need to use group by (Product_Family1__c, Product_Family__c) this query But getting error
Your Error Define your answer.Try to use ProductCode__c. Also try to execute below query on https://workbench.developerforce.com/query.php.
List<Asset> lst= [select Id, ProductCode__c, Product_Family1__c, Product_Family__c from Asset WHERE AccountId = '0015000000IBGof' AND ( (NOT IB_Status__c Like '%eval%') OR (NOT IB_Status__c Like '%Under Right of Return%') OR (NOT IB_Status__c Like '%Sold - Demo%') OR (NOT IB_Status__c Like '%WRITTEN OFF%') ) AND Product_Family__c != 'Whitewater'];
Check this link to user Group by in SOQL query http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_groupby_rollup.htm
Thanks for your reply,
Product2.ProductCode is giving me product id. I also need product name. But when I tried Product2.Name, It did`t work.
Also I tried GROUP BY ROLLUP(Product_Family__c) But it gives me error.
Could you please elaborate on it also.
chck this:
http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_groupby_rollup.htm
regards
MOhd
Its working for me.