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

dml operation using the bootstrap
public class Personal_Information{ public list<Personal_Information__c> perinfo{get;set;} public void Insertrecord(string name){ list<Personal_Information__c> listperinfo = new list<Personal_Information__c>(); Personal_Information__c perinfo = new Personal_Information__c(); perinfo .name = name; listperinfo.add(perinfo ); if(! listperinfo.isEmpty()){ insert listperinfo; } } } visualforce page: <apex:page controller="Personal_Information" sidebar="false"> <html> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script> </head> <body> <div class="col-sm-3"> <div class="form-group"> <label for="usr">Name:</label> <input type="text" class="form-control" id="usr" value ="{!name}" /> </div> </div> <br/> <button type="button" class="btn btn-success" action ="{!Insertrecord}" >Save</button> </body> </html> </apex:page>
without use of the salesforce standared fileds, records should have to insert using a custom button , it was not getting save , any wrong with this??
You cannot pass parameters to method bindings made in your Visualforce page to your controller. So in the controller add it like:-
If it helps, mark it as solved.
Thanks
All Answers
You cannot pass parameters to method bindings made in your Visualforce page to your controller. So in the controller add it like:-
If it helps, mark it as solved.
Thanks
thanks
sri
For more example see this link:-
https://developer.salesforce.com/forums/?id=906F0000000BTIPIA4
http://salesforceworld.blogspot.com/2011/06/parameter-passing-using.html
Hope it helps, if it does then mark it as solved.
Thanks
We can't call Apex functions from html. We should go for some VF attributes.
Below is the Action Function example, Thanks,
Govindaraj.S
<button type="button" action ="{!Insertrecord}" >Save</button>
thanks
<button type="button" class="btn btn-success" action ="{!Insertrecord}" >Save</button>
<input type="text" class="form-control" id="usr" value ="{!name}" />
and input should be
We can't call Apex methods directly from HTML. shall we know why do you don't want to use VF tags and need HTMl for this ?