You need to sign in to do that
Don't have an account?
vikmac
Error in APEX Trigger
Hello
I am writing an APEX trigger (after update) on custom object, in which I am using the standard object as -
Products p = [select p.products__c from product p];
I am getting the following error -
Error: Compile Error: sObject type 'Products' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names. at line 5 column 18
Please help...
Hey
Small error:
Products p = [select p.products__c from product p];
Remove that S and you should be okay.
Cheers,
Wes
And if you expect more than one result use a list to hold the query results e.g.
List<Product> products = [select p.products__c from product p];
Wes
Hey
Removing that 's' didn't solve the problem. Still getting an error as -
Please suggest some solution.
Thanks
Hey
I assumed Product was a standard object but it doesn't seem to be. Try this instead
List<Product__c> products = [select p.products__c from product__c p];
Wes
Hey
Products is a standard object..
Even I am wondering why am I getting this error...
Sorry dude, don't use the standard objects much. Here's the fix though, the products object is called product2 via the api. Try selecting from the object instead.. should sort you out.
Wes