New Task fields duplicating themselves in popup after save and clicking New Task again

  • 1
  • Problem
  • Updated 2 years ago
Little background: I'm creating a New Task popup in my Home page that details a scheduled task. I originally set up it's primary model "AddTask" with 'Create default row' unchecked and a record limit of 1.



In the Tasks table, I created a global action for Add New Task. under actions, I set 'Create new rows in AddTask, start of the model, edit mode', then produce a popup. In this New Task form I have a save which saves changes to AddTask, queries AddTask and the table model of OpenTasksToday and finally closes the popup.



Here's the issue: After the popup closes and the new task appears in the table, clicking on New Task again duplicates the form to enter tasks. Even though the box for 'create default row' is off since I'm doing just that in the actions section.



I've found that removing the action for creating a new row and checking the 'Create default' in the model does work. I can confirm the way I originally had set it up worked a few weeks ago.
Photo of Lou M.

Lou M.

  • 318 Points 250 badge 2x thumb
  • like more coffee could be the answer

Posted 2 years ago

  • 1
Photo of Chandra V

Chandra V, Champion

  • 6,966 Points 5k badge 2x thumb
On your field editor in your pop up, check to make sure the Context is set.  For your case, you'll want it to simply say Context Id = Id of the row in context.  That makes sure the field editor you are seeing is only the new one you are creating.

PS - you shouldn't need to query AddTask model on your save.  
Photo of Lou M.

Lou M.

  • 318 Points 250 badge 2x thumb
Hi Chandra,

Thanks for the quick response!

I don't think Context is what we're looking for. This process is for creating an entirely new task. 'Context Id = Id' implies that an ID already exists. which would be fine if we were editing a previously created task.

The same goes for querying. I'm querying on save to clear out what's been entered to the new Task. If I were editing one already created then true, I wouldn't query it.
Photo of Chandra V

Chandra V, Champion

  • 6,966 Points 5k badge 2x thumb
To clear out what you already have in the AddTask model, you might want to use an Empty Model action instead.  Rather than query the database.

What conditions do you have on your AddTask model?  The query will return any records that match the conditions you have set there.