Try to test remote objects in visualforce from a prechat form. Get a status :POST 200 but the record does not actually get inserted.
<!-- Remote Objects definition to set accessible sObjects and fields -->
<apex:remoteObjects>
<apex:remoteObjectModel name="ifttt__IFTTT_Event__c" jsShorthand="ifEvent" fields="Id,Name,ifttt__Message__c,ifttt__Type__c">
</apex:remoteObjectModel>
</apex:remoteObjects>
<input type="submit" value="Request Chat" class="form-control" id="prechat_submit" onclick="createEventForSF();"/>
<script type="text/javascript">
function createEventForSF() {
var ct = new SObjectModel.ifEvent({
Name: 'TEST',
ifttt__Message__c: 'Event from Chat',
ifttt__Type__c: 'Equipment'});
ct.get('Name');
ct.get('ifttt__Message__c');
ct.get('ifttt__Type__c');
ct.create();
}
</script>
Any idea what I could be doing wrong?