Forum Discussion

MikeMike1's avatar
MikeMike1
Qrew Cadet
7 years ago

Create New Action In Same Table

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

11 Replies

  • 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
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      Similar answer to mine but in fact there is no need to create a relationship.
    • PhillipDennis's avatar
      PhillipDennis
      Qrew Cadet
      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.
    • MikeMike1's avatar
      MikeMike1
      Qrew Cadet
      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
  • 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.
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    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.
  • 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.