Create New Action In Same Table

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
I'm trying to create a new Action that will allow for the automated creation of a new record in the same table.
This particular app is our CRM, so I would like to have a new renewal record created in the same table, only after the opportunity is booked as closed.

So workflow wise, it would be 

All within the Pipeline Table

Opportunity A is opened and all information required to close and book is entered.
Upon Save, Opportunity A(r1) is automatically created in the Pipeline Table.

I also may be interested in having the automated creation of 
Opportunity A(r1)
Opportunity A(r2)
Opportunity A(r3)

I've tried using the "Actions" button in the table settings, but it will not let me create within the same table.  It does not display as an option.

Thanks

Mike
Photo of Mike

Mike

  • 554 Points 500 badge 2x thumb
  • frustrated

Posted 1 year ago

  • 0
  • 1
Hi Mike. You can do it with an Action. The reason the Pipeline table doesn't show up as an option is because you can only add records to a table that the Pipeline table has a relationship with.

Solution: create a relationship between Pipeline and Pipeline.

When you do that, Quick Base will warn you that it's unusual to create a relationship with the same table, and it is. But there are cases in which it is appropriate, such as this. The reason is that there is a real-life relationship between the different records in your Pipeline table that is being modeled by this relationship in your app. You described the relationship yourself: renewal opportunities are related to closed/booked opportunities. A closed/booked opportunity should generate a related renewal opportunity.

After you create the relationship, I would recommend changing the field name from Related Opportunity (or whatever it's called) to Related Original Opportunity, or something along those lines, so it's clear that any record with a value in that field is a renewal that can be traced back to the original opportunity.

Important warning: 
be sure to set criteria for the Action so that adding a renewal record doesn't trigger it to add another renewal, and so on infinitely.

I hope this solution works for you. Let me know if you run into any difficulties.

PHILLIP DENNIS, CMA
Principal | Watkyn LLC
(954) 900-6690 | www.watkyn.com

Watkyn LLC
I think he's trying to add a record though, not edit one. Unless I'm mistaken, there has to be a relationship to use actions to add a record to a table.
Photo of Mike

Mike

  • 554 Points 500 badge 2x thumb
That's correct.  Once I've finished editing the current record and "closing" it, I want a new record (or records) created for the out years.
For instance, a customer buys an annual description of my software in 2017.  That record closes.  Then a NEW record would be creating in the Pipeline Table for the 2018 Renewal (and further if doing multiple).

Mike
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,766 Points 50k badge 2x thumb
Yes, I totally misread the question on my phone.

But once again I think the QuickBase Engineers were concerned about allowing users to set up looping actions. So it does appear that when you add a record you no longer are offered the choice to add a record of the same table because that could create a looping action.

I did a quick test by relating a table to itself and that didn’t help. I was still blocked from creating that action.

I think that this would have to be done with the web hook, which of course are a little more complicated to set up, or else you could have a URL formula button for the user to push which would create the additional records.
In testing this, I was able to create a same-table relationship and an action that added a record to it, so fingers crossed that this works as described. If not, the webhook solution you mention would be the next best thing.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,766 Points 50k badge 2x thumb
Interesting. . I will have to try my test again.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 53,038 Points 50k badge 2x thumb
No problem.


When it says to edit related records, that’s is really not what it means. Mits just worded that way to help new usesrs.


It can edit any set of records as define by the matching criterial in a Report Link field.


As we know, you don't need a Relationship have a Report Link field. You can make one yourself. So make a Reportblink field from the record to itself. Ie match on Record ID# in the left, and on the right side navigate all the way back to your same app, and same table and the same Record ID#.


So obviously, there is only going to be one matching record, the record you are sitting on.


Now, be sure in your conditions for firing that you do not create a loop. Because when the Action fires, it is an edit which could cause an action to be fired, which edits the record and triggers the Action to be fired, which edits the record .... you get the idea.


That in fact is why edit the same record you ar on, was not released as an obvious possibility when that launched Actions a few months ago,. How to prevent many users from making lopping Actions. They willl time out after 10 loops by the way. The max rate is 10 per second and then they max out and throw an error by email.
(Edited)
Photo of Matthew Neil

Matthew Neil

  • 31,478 Points 20k badge 2x thumb
If Actions and Webhooks don't work for you, try just making a formula url button that creates the new record via API_AddRecord.

Your button could do it all.  Change the current record to closed, and create a new.  One click, and it happens right away.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 53,038 Points 50k badge 2x thumb
I agree with Matthew. Then the button(s) can also make the correct number if children. They can be formula URL buttons so no code, really.
Yep, that works too, as long as there's no danger of someone forgetting to click the button or clicking it multiple times by mistake. The danger of someone forgetting to click the button could be mitigated with a report subscription showing opportunities that don't have related renewal opportunities.