I am trying to update a field on a record using an OnClick Javascript button. It seems to be updating the record but when I refresh the page nothing shows. What am I doing wrong?
Below is my code:
{!requireScript("/soap/ajax/34.0/connection.js")}
var jobRequisition = new sforce.SObject("Job_Requisition__c");
jobRequisition.Id = "{!Job_Requisition__c.Id}";
jobRequisition.requisition__c = 'Something';
var result = sforce.connection.update([jobRequisition]);
window.location.reload();
When I check the result I get this error:
{errors:{fields:'Id', message:'Record ID: id value of incorrect type: 559e1e161ef6752dff2ff0f1', statusCode:'MALFORMED_ID', }, id:null, success:'false', }
I have a field called id__c with the "559e1e161ef6752dff2ff0f1" value, but I specified jobRequisition.Idin the above code so I do not understand why it is referencing that. I believe this should be the salesforce Id not my custom field
resultfor success?{!Job_Requisition__c.Id}on line three?