# Is it possible to run a script upon a creation of a contract

**URL:** <https://forum.canton.network/t/is-it-possible-to-run-a-script-upon-a-creation-of-a-contract/4119>\
**Category:** App Development\
**Tags:** daml-script, daml\
**Created:** [March 15, 2022, 10:38pm UTC](https://forum.canton.network/t/is-it-possible-to-run-a-script-upon-a-creation-of-a-contract/4119 "2022-03-15T22:38:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cohen.avraham](https://avatars.discourse-cdn.com/v4/letter/c/a87d85/32.png) [@cohen.avraham](https://forum.canton.network/u/cohen.avraham)\
**Post date:** [March 15, 2022, 10:38pm UTC](https://forum.canton.network/t/is-it-possible-to-run-a-script-upon-a-creation-of-a-contract/4119/1 "2022-03-15T22:38:54Z")

</div>

G-d willing

Hello,  
I have a scenario where a major company has a list of business customers, where every business customer has its own list of private customers.  
For this example, let’s call the major company A, which has 1 business customer called B. And B has 2 private customers called C, and D. We should assume that A is **not aware** of C and D.

I would like to make sure that once A sends an offer to his customer B, automatically B will send an offers to both C and D.  
Is it possible? If so, how can I do it?

Thanks,

---

<div class="post-metadata">

**Author:** ![Mate\_Varga](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/mate_varga/32/2308_2.png) [@Mate\_Varga](https://forum.canton.network/u/Mate_Varga)\
**Post date:** [March 16, 2022, 10:44am UTC](https://forum.canton.network/t/is-it-possible-to-run-a-script-upon-a-creation-of-a-contract/4119/2 "2022-03-16T10:44:46Z")

</div>

For such an automation, I would say that the same applies as described in the aswer by @Gary_Verhaegen to your post: [How to trigger an action once a specific date & time reached](https://discuss.daml.com/t/how-to-trigger-an-action-once-a-specific-date-time-reached/4112). You are not able to reference C and D when you create the contract acting as A, so I would approach it by creating a trigger/client application that listens for these creations and create the offers to C and D on behalf of B.

---

<div class="post-metadata">

**Author:** ![cohen.avraham](https://avatars.discourse-cdn.com/v4/letter/c/a87d85/32.png) [@cohen.avraham](https://forum.canton.network/u/cohen.avraham)\
**Post date:** [March 16, 2022, 12:52pm UTC](https://forum.canton.network/t/is-it-possible-to-run-a-script-upon-a-creation-of-a-contract/4119/3 "2022-03-16T12:52:19Z")

</div>

Okay, thank you very much @Mate_Varga 👍
