Hey guys, I have a JS mass action that worked great until I installed Rockaway. The console is saying: Uncaught TypeError: Cannot read property ‘Id’ of undefined The source marks the error on this line of code: var CaseID = proto.Case__r.Id; I read Irvin’s message about a similar error, and the resolution had to do with add a trivial sub condition to a subquery. Is that the same error we have here? Also, how do I actually do that? Full snippet: var params = arguments[0];var step = params.step;var $ = skuid.$; // REFERENCE MODELS var models = skuid.model.map(); var protoAppt = models.protoAppt; var newAppts = models.newAppts; var proto = protoAppt.getFirstRow(); // GET conditions var caseCondition = newAppts.getConditionByName(‘Case’); var userCondition = newAppts.getConditionByName(‘User’); var recurrencetotalCondition = newAppts.getConditionByName(‘RecurrenceTotal’); var recurrencestarttimeCondition = newAppts.getConditionByName(‘RecurrenceStartTime’); var recurrenceendtimeCondition = newAppts.getConditionByName(‘RecurrenceEndTime’); var recurrenceapptidCondition = newAppts.getConditionByName(‘RecurrenceApptID’); var recurrenceisrecurrenceCondition = newAppts.getConditionByName(‘RecurrenceIsRecurrence’); // SET conditions newAppts.setCondition(caseCondition,protoAppt.getFieldValue(proto,‘Case__c’)); newAppts.setCondition(userCondition,protoAppt.getFieldValue(proto,‘User__c’)); newAppts.setCondition(recurrencetotalCondition,protoAppt.getFieldValue(proto,‘RecurrenceNumberTotal__c’)); newAppts.setCondition(recurrencestarttimeCondition,protoAppt.getFieldValue(proto,‘StartDateTime__c’)); newAppts.setCondition(recurrenceendtimeCondition,protoAppt.getFieldValue(proto,‘EndDateTime__c’)); newAppts.setCondition(recurrenceisrecurrenceCondition,protoAppt.getFieldValue(proto,‘RecurrenceIsRecurrence__c’)); newAppts.setCondition(recurrenceapptidCondition,protoAppt.getFieldValue(proto,‘Id’)); // SET loop vars var CaseID = proto.Case__r.Id; //ERROR CAUSED BY THIS LINE var CaseName = proto.Case__r.Name; var UserID = proto.User__r.Id; var UserName = proto.User__r.Name; var loopRecurrenceNumber = 1; var loopRecurrenceNumberTotal = protoAppt.getFieldValue(proto,‘RecurrenceNumberTotal__c’); var loopStartDateTime = protoAppt.getFieldValue(proto,‘StartDateTime__c’); var jsloopStartDateTime = skuid.time.parseSFDateTime(loopStartDateTime); var loopEndDateTime = protoAppt.getFieldValue(proto,‘EndDateTime__c’); var jsloopEndDateTime = skuid.time.parseSFDateTime(loopEndDateTime); var loopDate = protoAppt.getFieldValue(proto,‘Date__c’); var jsloopDate = skuid.time.parseSFDate(loopDate); // ACTION CODE - loop and set non default values var i=1; while(i < 54){ var row = newAppts.createRow({ additionalConditions: [ {field: ‘RecurrenceNumber__c’, value: i}, {field: ‘Case__c’, value: CaseID, operator: ‘=’, nameFieldValue: CaseName}, {field: ‘User__c’, value: UserID, operator: ‘=’, nameFieldValue: UserName}, {field: ‘RecurrenceIsRecurrence__c’, value: ‘True’}, {field: ‘Date__c’, value: loopDate}, {field: ‘Start_Time__c’, value: protoAppt.getFieldValue(proto,‘Start_Time__c’)}, {field: ‘End_Time__c’, value: protoAppt.getFieldValue(proto,‘End_Time__c’)}, {field: ‘Subject__c’, value: protoAppt.getFieldValue(proto,‘Subject__c’)}, {field: ‘Type__c’, value: protoAppt.getFieldValue(proto,‘Type__c’)} ] }); var jsloopStartDateTime = skuid.time.parseSFDateTime(loopStartDateTime); jsloopStartDateTime.setDate(jsloopStartDateTime.getDate() + 7); var loopStartDateTime = skuid.time.getSFDateTime(jsloopStartDateTime); var jsloopEndDateTime = skuid.time.parseSFDateTime(loopEndDateTime); jsloopEndDateTime.setDate(jsloopEndDateTime.getDate()+7); var loopEndDateTime = skuid.time.getSFDateTime(jsloopEndDateTime); var jsloopDate = skuid.time.parseSFDate(loopDate); jsloopDate.setDate(jsloopDate.getDate()+7); var loopDate = skuid.time.getSFDate(jsloopDate); //loopRecurrenceNumber = loopRecurrenceNumber + 1; //console.log(loopRecurrenceNumber); i++; } // FINISH CODE step.navigate(‘step2’);
Question
Rockaway - Uncaught TypeError (Id) in my Snippet
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
