I am trying to update the Custom Setting using remote Object in visualforce page, the scenario is when every time on load of the page I want to update the sessionId in custom setting, but using remote object I am not able to do that,
Here is my code of vf page which is not working on update
<!-- defining custom setting here -->
<apex:remoteObjects jsNamespace="RemoteObjectModel">
<apex:remoteObjectModel name="Config__c" fields="Id,PartnerUrl__c,SessionId__c">
</apex:remoteObjectModel>
</apex:remoteObjects>
<script>
//to save data in custom setting
function remot() {
var ct = new RemoteObjectModel.Config__c({
PartnerUrl__c: '{!$Api.Partner_Server_URL_310}',
SessionId__c: '{!$API.Session_Id}',
});
ct.update();
}
remot();
</script>