+ Start a Discussion

owner id is not working



I have sand box account of client. In that account i have the custom object as testing. Now i wrote the trigger for the testing object. Want to collect the owner id of object in to set. When i add the owner id in to set it gives the error as 


No such column 'ownerid' on entity 'testing__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name.


and i queried from system log (system.debug([select ownerid from application__C]);)also it give the same error. This object contain master detail look up with opportunity. 


In the same account the owner id working for the custom object which is not having the look up with any object. How to solve this error and how to collect the owner id of custom object.


The owner information isn't available in a detail record - it is automatically set to the owner of the master record.  Thus you'll need to execute a SOQL query to extract the owner of the master record.