I am having troubles creating a row action on an account table which will render a popup with the WhoId already populated to that row’s account… This seems like it would be simple, but I try to set the context and then the field editor does not render.
Have you set the condition of the model of the table in popup to be whoid to be equal to the account id?
Sorry, the condition of the model of the field editor in popup to be whoid to be equal to the account id?
I set the what.id of record(s) = id of row in context
Which object are you using for the model in the field editor of the popup?
the model is a task with no conditions
Oh wait. You’re creating a new task in the Task Object to be related to the Account. Make sure your Task Model is setup this way.
Also to note. The Account Name doesn’t seem to show until the task has been saved. I think that’s because the WhatId is used behind the scenes to update this field after saving the record. Actually, it must be done this since the task table is dynamically attached to any object in the system. There would be no way to display the Account Name until after saving the record.
Bummer, so there is no way to have the Whatid field render based on the account row in context?
Close. I included the whatid in the popup and got this.
That looks right! How did you do that?
{{Model.labelPlural}}
Home
Task
{{Subject}}
{{Model.label}}
NewTask
I got it! Just in case anyone ever searches this, I used this snippet to create a new task who’s account is assigned as the row in context. I needed this row action to render a popup so I could log tasks to that account without having to actually go in the account.
var params = argumentse0], accountRow = params.item ? params.item.row : params.row, accountModel = params.model, $ = skuid.$; // Create our new Task var NewTaskModel = skuid.model.getModel('LogAction'); var NewTask = NewTaskModel.createRow(); NewTaskModel.updateRow(NewTask,{ 'WhatId': accountRow.Id }); // Link our Account to this Task accountModel.updateRow(accountRow,{ 'WhatId':NewTask.Id, 'Task':NewTask }); // Return our new Task row as our context return { row: NewTask };<br>
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.