You need to sign in to do that
Don't have an account?
Vigneshwaran Loganathan
Can anyone help me for this, I know where it goes wrong.. I have queried correctly but still its showing the error.. Any mistakes here?
SObject row was retrieved via SOQL without querying the requested field: Legal_Action__c.Name_of_Client__c
public with sharing class legalactionsubmission { public legal_action__c legact{get;set;} public String currentid= ApexPages.currentPage().getParameters().get('id'); public boolean savedis{get;set;} public string idcurr; public legalactionsubmission(ApexPages.StandardController controller) { savedis=false; legact=new legal_action__c(); legact=(legal_action__c)controller.getrecord(); system.debug('>>>legact'+legact); this.idcurr=ApexPages.currentpage().getparameters().get('id'); if(currentid!=null && currentid!='') { //Legal_Action__c a = new Legal_Action__c(); legact=[select id,submit_done__c,entry_by__c from legal_action__c where id=:currentid]; if(legact.submit_done__c==true) { savedis=true; String msg = 'Thank you for Submitting.'; ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM,msg)); } } } public pagereference save() { savedis=true; legal_action__c leg= new legal_action__c(); //legal_action__c legact= new legal_action__c(); system.debug('>>>legact'+legact); leg=[select id,Name_of_Client__c,submit_done__c,Name_of_VA__c,entry_by__c,reviewed_by__C,Summary_of_Situation__c,Attachment_summary__c from legal_action__c where id=:currentid]; if(leg.submit_done__c==false) { leg.Name_of_Client__c=legact.Name_of_Client__c; // Error Line leg.submit_done__c=true; leg.Name_of_VA__c=legact.Name_of_VA__c; leg.entry_by__c=legact.entry_by__c; leg.reviewed_by__C=legact.reviewed_by__C; leg.Summary_of_Situation__c=legact.Summary_of_Situation__c; leg.Attachment_summary__c=legact.Attachment_summary__c; update leg; system.debug('>>>>entryby'+leg.entry_by__c); } pagereference ref; ref = new pagereference('/apex/legal_action_final_reviewe?id='+legact.id); ref.setredirect(true); return ref; } }Hi,
Can anyone help me for this, I know where it goes wrong.. I have queried correctly but still its showing the error.. Any mistakes here?
Change your query on line 18 like following
All Answers
Let me know if it does not work.
Change your query on line 18 like following