Javascript Remoting : Pass parameters from javascript to Salesforce standard object field
Here we are going to pass the sobject from the java script to apex using javascript remoting to insert the record in the database. Here we are going to use our custom object to pass parameter to apex and insert the record. I am using the custom object name as CustomObj__c . Then the controller name is MyCustomController. The code is given below Step 1: Need to write javascript code to create the customobject mannually. the customobject in javascript is given below function CustomObj__c(){ this.Id= null; this.name__c = null; this.address__c = null; } Then create the instance for the function. ie object var custObj = new CustomObj__c(); step 2: Then assign the calue what you want to store. custObj.name__c = 'RamaKavanan'; ...