I have a need to update a custom field: comp_datelastnote (date/time) when a user inserts or updates a Note. I've been reading through posts for a few days to try to piece the solution together. Currently I'm here:
var myCompanyID = CRM.GetContextInfo('Notes','note_foreignid');
var myUpdatedDate = CRM.GetContextInfo('Notes','note_updateddate');
var myCompanyRecord = CRM.FindRecord('Company', 'comp_companyid='+myCompanyID);
myCompanyRecord.comp_LastNoteDate = myUpdatedDate;
myCompanyRecord.SageChanges();
The code above is returning an error message on the 5th line: "myCompanyRecord.comp_LastNoteDate = myUpdatedDate;"
Error: "Object doesn't support this property or method..."
Any guidance would be appreciated.