How to Click a Button in a snippet

  • 4
  • Question
  • Updated 2 years ago
  • Answered
I am creating new records in a pop up, and I want to use a Save and New button to create a second record.  When I save my first record and create a new row in my model, the context id doesn't get re-passed to my new record.

So, I am trying now to use action framwork to:
- Save my new record in my pop up
- Close the pop up
- automagically open the pop up back up (which creates a new record again) for the user to enter their 2nd record into

Can someone tell me the syntax of the snippet I need that simulates a click of my Create Record button?  I don't want to use a 2nd "new record" model.  We are trying to simplify the page and eliminate necessary model querying.

Thanks!
Photo of Chandra V

Chandra V, Champion

  • 6,988 Points 5k badge 2x thumb

Posted 2 years ago

  • 4
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,774 Points 20k badge 2x thumb
Did this a couple weeks back.

document.getElementById("addMember").click();



Photo of Chandra V

Chandra V, Champion

  • 6,988 Points 5k badge 2x thumb
Perfect!!!  Day made... thanks, Pat!
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,774 Points 20k badge 2x thumb
Quite welcome.