I am trying to update a field inside row action popup window using action “update field on row” added to button click. The problem is that it updates all the rows with the updated value whereas the desired result should be only updating the current row’s field.
How are your actions set up?
I have a table component that lists all the shipping items (uses relatedShippings model) which has a row action to open up a popup. Inside the popup I have field component with the same model (relatedShippings). I have a button inside that popup window which runs action (update field on row) to update status field on opened record to “shipped”. The problem is that it changes all the items in the table component to “shipped”.
There are several strategies you can use. One option would be to read the row into a separate model and associate this new model with the field editor. On Save, you will need to re-query the relatedShippings model to pick up the changes.
Thanks for the reply. could you provide me info on how to move single row data to a model…I am not sure how to do this on skuid.
I think the basic problem is that somewhere in your action sequence tied to the row action - you are losing context. This most often happens when you create a new row. So if you can put your field update action first in your action sequence the problem should not occur.
Thanks this works!! One other thing I needed to change was the model to the correct one on title component where the button was added. Also had to set context to “Id of records = Id of row in context” for the title component.
Reading into a separate model worked for me! I was able to use the initial context to set the Id of the current row on a secondary model, then create a record, then query that record to get the Id of the new record, then update a field on the “row in context” with the Id of the new record. Prior to this I kept losing context, and my process was updating ALL records returned by the original model, which was a problem.
So, thank you Irvin for the suggestion.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.