Activity › Forums › Salesforce® Discussions › Why we can’t make Salesforce Query in the Constructor? Tagged: Constructor, Help & Training, Salesforce Query Salesforce® Discussions Why we can’t make Salesforce Query in the Constructor? Posted by Suraj on May 9, 2017 at 1:53 PM Why we can’t make Query in the Constructor? Saurabh replied 9 years, 1 month ago 2 Members · 1 Reply ConstructorHelp & TrainingSalesforce Query 1 Reply Saurabh Member May 11, 2017 at 7:07 AM Hi Suraj No you can’t perform any DML in Constructor. If you want to Perform DML then you have to write a function in class and call this functon by action attribute of <apex:page action=”YOUR Funciton Name”> for more infohttp://salesforceworld4u.blogspot.in/2014/08/how-to-do-dml-operation-when-page-loads.html Hope it may help you Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me