Create default row for empty model when queried after pageload

  • 1
  • Question
  • Updated 3 years ago
I have a use case where I don't want to load a model on page load, because there's a good chance it will not be needed at all. However, if I do need it, I'd like the model to create a default row if there isn't one.

I suppose I could run some javascript on query to create a row if there isn't one... but it seems like a fairly simple thing. Is there any way with the action framework?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
Can you trigger off some event e.g. user clicking a button?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
I was hoping to go with a model action based on a field change. A button would work, too, to initiate the query.
I can always create a row in the action sequence,... but I don't want to create a row if a row exists that meets the criteria.
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
Yup, maybe next version of the AF :)  Sounds like you are back to JS.