I need to reference selected rows in a table that is no longer in context. I can get it to work with all returned records, but not with specific rows. My table is name UpdateForm1. I’m trying to set the Id from each row as the WhatId in the snippet below: var params =argumentst0]; var $ = skuid.$; var models = skuid.model.map(); // Define “What” model (Record Ids from this model will be used as the WhatId) var updateForm = models.VendorChecklist; // Define the task model where new row will be created var newActivity = models.NewActivity; // Define the task model used to create the temporary Task (End user sets field values from this model) var taskModel = models.TaskHistory; //Define the task record Fields that will be used on the new task records var thisActivityAssignedTo = taskModel.getFirstRow().OwnerId; var thisActivitySubject = taskModel.getFirstRow().Subject; var thisActivityWho = taskModel.getFirstRow().WhoId; var thisActivityIntCat = taskModel.getFirstRow().Interaction_Category__c; var thisActivityIntSub = taskModel.getFirstRow().Interaction_Subject__c; var thisActivityDate = taskModel.getFirstRow().ActivityDate; var thisActivityComments = taskModel.getFirstRow().Description; // Loop through each record to create a new task record in the NewActivity model $.each(updateForm.getRows(),function(i,row){ var currentId = this.Id; var newrow = newActivity.createRow({ additionalConditions: i { field: ‘OwnerId’, value: thisActivityAssignedTo, operator: ‘=’ }, { field: ‘Subject’, value: thisActivitySubject, operator: ‘=’ }, { field: ‘WhoId’, value: thisActivityWho, operator: ‘=’ }, { field: ‘WhatId’, value: currentId, operator: ‘=’ }, { field: ‘Interaction_Category__c’, value: thisActivityIntCat, operator: ‘=’ }, { field: ‘Interaction_Subject__c__c’, value: thisActivityIntSub, operator: ‘=’ }, { field: ‘ActivityDate’, value: thisActivityDate, operator: ‘=’ }, { field: ‘Description’, value: thisActivityComments, operator: ‘=’ }, { field: ‘Status’, value: ‘Completed’, operator: ‘=’ } ] }); console.log(newrow); });
Be the first to reply!
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.