3 Antworten
@kaplesh : I have already tried this but no luck.
@Soundar : I tried the same thing you have written but facing one error i.e When I enter more than 100 in 5 different fields it given me error on the top but when i enter les than 100 value and hit save the page remains on the same edit mode but in the backend it does create record.
Below is the Save() method : public PageReference SaveRec(){Try{
if(proj.Name!=null && proj.Name!=''){
insert proj;
}
}
catch(Exception ex){
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.FATAL,'Please enter The Project Name'));
}
//return null;
return new PageReference('/' +proj.id).setRedirect(true);
}
public PageReference doCancel(){
return new PageReference('/a01/o').setRedirect(true);
} This is what i am using because i want my page to return to projects ID & should not return null thaty's why commented it. And with this code i get following error :Update failed. First exception on row 0 with id a012600000FWE90AAH; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Work spread cannot be > 100%: []
Error is in expression '{!SaveRec}' in component <apex:commandButton> in page projectscustomeditpage: Class.ProjectsCustomEditPageCtrl.SaveRec: line 25, column 1Let me know if you can help here..!!