0
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

1

Do you have Visibily on that Field? Default standard Product Code in asset object is not visible, otherwise you can access to the ProductCode by Product2.ProductCode.

0

Not sure if you want the Product Code field or if you just need the record Id.

The field on the Asset object is 'Product2Id', and if you need the Product Code, you can query for 'Product2.ProductCode'.

A good way to test a query is to go to the Developer Console and open the object under the File menu. From there you can see the fields/types and test queries.

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.