Jump to content
  • 0

Creating and adding childrecords


BertM

Question

This is the issue: I want to create child records and than count  the number of child records that was created. And store that number in a data field in the parent record. Probably in one triggered action, because different triggered actions is not allowed. What to do?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0



image.png.bc3c3e61e4956ccf4820a93c7cec6f8e.png

@BertM If the creation of child records will originate from creating parent record as well, you can use this trigger on the parent table.

If you dont have an update trigger on the parent table, this should work properly with @AtayBalunbalunan's trigger. Otherwise, you would have an cascading error.

@AtayBalunbalunan, thank you for the tip about getting the count, I did not know that you can get the count of records with just the 'expression field', I thought that a group function is required for that.



 

Link to comment
Share on other sites

  • 0

This may be possible using triggered action depending on your workflow. How are you going to add new child records?

If you are stamping an ID from the parent record to the child record upon insertion, you can update the value of the total number of child records in the parent record. Below is a sample.

image.png.4216ff7764647f781c63f59e0a69e0be.png

Your trigger will be different based on your table design.

Link to comment
Share on other sites

  • 0
On 8/9/2020 at 11:17 PM, BertM said:

This is the issue: I want to create child records and than count  the number of child records that was created. And store that number in a data field in the parent record. Probably in one triggered action, because different triggered actions is not allowed. What to do?

@AtayBalunbalunan and @NiceDuck Thank you, problem solved

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...