You need to sign in to do that
Don't have an account?

Can't Perform save Function in Apex
So i'm trying to save a record on a visual force page but it won't perform the save function. It gets into the method but never actually grabs the information from the page. NAy Ideas? Here is my Code
Class
Page
Class
public with sharing class nCino_CustomerHealthIndividual{ public string CHidNum = Apexpages.currentPage().getParameters().get('id'); public Customer_Health__c CustomerHealth {get;set;} public nCino_CustomerHealthIndividual(){ this.CustomerHealth = getCustHealth(); } public PageReference save() { update this.CustomerHealth; return null; } //Customer Health Fields public List<Schema.FieldSetMember> getCHFields() { return SObjectType.Customer_Health__c.FieldSets.Main.getFields(); } public Customer_Health__c getCustHealth() { String query = 'SELECT '; for(Schema.FieldSetMember f : this.getCHFields()) { query += f.getFieldPath() + ', '; } query += 'Id, Name FROM Customer_Health__c WHERE Id = :CHidNum LIMIT 1'; return Database.query(query); }
Page
<apex:form> <!-- Edit System Information --> <div class="modal modal-flex fade" id="editsysteminfomodal" tabindex="-1" role="dialog" aria-labelledby="editsysteminfomodallabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="editsysteminfomodallabel">Edit System Information Section</h4> </div> <div class="modal-body"> <form class="form-horizontal" role="form"> <div class="form-group"> <label class=" col-md-5 control-label">nCino Sandbox Version</label> <div class="col-md-7"> <apex:inputField value="{!CustomerHealth.Sandbox_Version__c}"/> </div> </div> </form> </div> <div class="modal-footer"> <apex:commandButton value="Save" action="{!save}"></apex:commandButton> </div> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> <!-- /.modal --> </apex:form>
The apex:pageMessages should print out a informational message to help you fix your issue. You could also add debug logs to your save method as well.
Change the Save() method name to some other name and call from Save button in VF page. There is the possibility of contradiction in standard method name Save().