Discussions

 View Only
Expand all | Collapse all

Automatically create child record when parent record saved

  • 1.  Automatically create child record when parent record saved

    Posted 04-08-2015 16:26
    Is it possible to, when my parent record is saved, have a formula that will (if a specific field has been updated), automatically create a child record on my related child table, populated it with the data from that field and then save it (without the user having to hit Save manually)

    Thank you in advance!!


  • 2.  RE: Automatically create child record when parent record saved

    Posted 04-08-2015 16:51
    That's not possible, but it's certainly possible to have a button to push to create a child record, and the button could be set to only appear if certain conditions are met.  You would use the API called API_AddRecord.  Post back if you need help with that.


  • 3.  RE: Automatically create child record when parent record saved

    Posted 03-07-2017 01:50
    Mark

    I may need this solution. Could you guide me through? 


  • 4.  RE: Automatically create child record when parent record saved

    Posted 03-07-2017 02:03
    This can now be achieved with Webhooks


  • 5.  RE: Automatically create child record when parent record saved

    Posted 03-07-2017 02:17
    How?


  • 6.  RE: Automatically create child record when parent record saved

    Posted 03-07-2017 02:43
    This is my gripe that QB want to put out a feature with much  fanfare but they don't want to support or provide learning.  


  • 7.  RE: Automatically create child record when parent record saved

    Posted 03-07-2017 13:35
    Webhooks are currently very technical. I understand that they plan to introduce a "lite" version of Webhooks which will only work within QuickBse and will be user friendly to set up. But I don't know when that will be released.

    Many of us have expressed that the training materials for Webhooks assume a very high level of technical skills and don't have much in the way of examples.

    Right now, the only realistic way is to get some help from a developer for your first few Webhooks and then you can be more self sufficient.


  • 8.  RE: Automatically create child record when parent record saved



  • 9.  RE: Automatically create child record when parent record saved

    Posted 03-07-2017 21:12
    Very nice article.  Many thanks. 


  • 10.  RE: Automatically create child record when parent record saved

    Posted 07-22-2015 20:23
    Is there a way to just auto save that new child record so that you don't have to navigate from the parent record? My child record is only pulling info from the parent, no new info is being added.


  • 11.  RE: Automatically create child record when parent record saved

    Posted 11-06-2017 20:55
    I am following the article link above and it is working well except for the following 2 items.
    1.  I had to disable my app tokens to get this to work.  What code would I need to add to get the app token to work again?
    2.  I have to save the project before clicking on the button for it to work.  What do I need to add to the button formula to save the project first and then create the child records?


  • 12.  RE: Automatically create child record when parent record saved

    Posted 11-06-2017 21:01
    To get the app tokens to work, you need to add a line to the URL

    & "&apptoken= xxxxxxxxx"

    With the method described in that article you will need to save the record before importing the children.  How many children are you adding?


  • 13.  RE: Automatically create child record when parent record saved

    Posted 11-06-2017 21:09
    Thanks for the info on the app token.

    The number of children varies depending on the selection, but a minimum of 5.  The current button I am working on adds 5 records.  Is there something I can add to the URL formula to save the parent record first and then create the children?

    Here is my current formula:

    var text SetFocus = URLRoot()&"db/"&[_DBID_FOCUS_TASKS]

    & "?act=API_EditRecord&rid=1"

    & "&_fid_6=" &[Record ID#];

    var text RunImport= URLRoot()& "db/"&[_DBID_TREATMENT_BATCHES]& "?a=API_RunImport&ID=10";
    var text RefreshRecord= URLRoot()&"db/"&Dbid()&"?a=dr&rid="& ToText([Record ID#]);

    $SetFocus
    &"&rdr="& URLEncode($RunImport)
    &URLEncode("&rdr="& URLEncode($RefreshRecord))


  • 14.  RE: Automatically create child record when parent record saved

    Posted 11-06-2017 21:12
    I do not believe that there is a way to do that without using script.  The issue is that to create the children, they need to know the Record ID# of the parent.  But the Record ID# of the Parent is not known until it is saved.


  • 15.  RE: Automatically create child record when parent record saved

    Posted 11-06-2017 21:21
    Darn.  I was hoping there was something easy I could add to the URL formula.

    Seems like a major flaw of the whole process outlined in the article.


  • 16.  RE: Automatically create child record when parent record saved

    Posted 11-07-2017 01:22
    Maybe you should start at the beginning with your goal.

    If all you want to do is to start with say a half a dozen templated projects which each have a different set of tasks, click 1 button and get a copy of the project made along with its set of tasks, then all you want to do is to use the native functionality to Copy Master Detail.

    That button is on App management and that will walk you though the setup in a few clicks.

    Is that your real goal?

     


  • 17.  RE: Automatically create child record when parent record saved

    Posted 11-06-2017 21:35
    Using script is easy and it solves all problems.


  • 18.  RE: Automatically create child record when parent record saved

    Posted 11-06-2017 21:55
    I don't understand.  Can the script be added to the formula-url?  What script would need to be added?


  • 19.  RE: Automatically create child record when parent record saved

    Posted 11-07-2017 01:00
    By "script", I mean that you will need to engage with a developer to get this working for you and scrap what you have done so far.  If you contact me via the information in my website QuickBaseCoach.com, I can recommend a developer to do this for you.