Should mark row(s) for deletion in action framework obey context conditions?

  • 1
  • Question
  • Updated 4 years ago
  • Answered
I have a calendar popup. Within the popup, a page title component with context Id = Id.

When I run an action sequence from a button on that page title component, I would expect the actions to obey the context, so "Mark row(s) for deletion" would only mark the context row for deletion, not all rows.

Incidentally, any way to get those rows back?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Recycle Bin :)

I'll take a look at the error.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Zach,

Any updates on this? I just has a slew of rows deleted again... :(
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Matt, what version of Skuid are you running? This should be working if your Page Title has a Context Condition and your Page Title is on the same Model that you are marking rows for deletion in. Is the Model on your Page Title the same as the Model you are Marking rows for Deletion in using the Action Framework?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
6.8.14

Page Title has context conditions (Id = Id) and is on the same model as the row to be marked for deletion.

However, it looks like I'm creating a row on a different model earlier in the action sequence. I'm guessing that's messing up the context?
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Yeah I think that is messing up the context. Can you move the Create New Row action after doing the Mark Rows for Deletion action?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
I'm not sure that I can. Here's relevant part of my sequence:

  1. Create Row in OtherModel (using data from ContextModel)
  2. Cancel Model Changes
  3. Mark Row(s) for deletion
  4. Save Model(s) (ContextModel and OtherModel)

I had to add the Cancel Model changes action because I was getting some errors for blank required fields on save. If I move Mark Rows for deletion before the Create Row, then that change would also be cancelled, correct?

Seems like I'm going to have to figure out what those changes are that were causing the save error, so I can eliminate the Cancel action and move the Mark action.
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Can you include the Model Names for 2 and 3? Hard to say what to do without knowing which Models you're cancelling or Marking for Deletion.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Ah, sorry for the lack of clarity!

  1. Create Row in OtherModel (using data from ContextModel)
  2. Cancel Model Changes (ContextModel)
  3. Mark Row(s) for deletion (ContextModel)
  4. Save Model(s) (ContextModel and OtherModel)
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
So... I just changed the sequence to 

  1. Mark Row(s) for deletion (ContextModel)
  2. Create Row (in OtherModel using data from ContextModel)
  3. Save Model(s) (ContextModel and OtherModel)

And it's working fine...

Not sure where the old error went, but it's gone! :)