# Triggered transacting group

**URL:** <https://forum.inductiveautomation.com/t/triggered-transacting-group/27690>\
**Category:** Ignition\
**Created:** [August 22, 2019, 9:36pm UTC](https://forum.inductiveautomation.com/t/triggered-transacting-group/27690 "2019-08-22T21:36:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![damean.thomas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/damean.thomas/32/11367_2.png) [@damean.thomas](https://forum.inductiveautomation.com/u/damean.thomas)\
**Post date:** [August 22, 2019, 9:36pm UTC](https://forum.inductiveautomation.com/t/triggered-transacting-group/27690/1 "2019-08-22T21:36:20Z")

</div>

I have a a windows that product information is entered by operators. I have a transaction group for the tags in the window that is triggered by a submit button tied to a submit tag in this group.All fields must be populated to enable the submit button.I tried to add a script to the submit button that would clear the fields by placing " " in the string fields and 0 in the numeric fields when the button is pressed. My problem is that half of the time everything works perfectly, the tags are written to the database then the fields are cleared. Other times the fields are cleared before the transaction group is inserted into the database. Is there a way that i can ad a delay to the script clearing the fields to allow time for the transaction group to process? i have this broken into 2 separate buttons to work around this for the interim but would like to recombine these to limit the possibility of multiple submit entry’s.

if it will help this is the script used:

```auto
event.source.parent.parent.getComponent('ActionData').getComponent('drumPart').text= ""
event.source.parent.parent.getComponent('ActionData').getComponent('drumLot').text= ""
event.source.parent.parent.getComponent('ActionData').getComponent('gross').doubleValue=0
event.source.parent.parent.getComponent('ActionData').getComponent('backWt').doubleValue=0
```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 22, 2019, 9:49pm UTC](https://forum.inductiveautomation.com/t/triggered-transacting-group/27690/2 "2019-08-22T21:49:56Z")

</div>

Don’t use a transaction group for user-triggered database operations. Don’t even use tags for these fields. Use a named query that is fed the field contents directly, and close the window after the query runs.

---

<div class="post-metadata">

**Author:** ![damean.thomas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/damean.thomas/32/11367_2.png) [@damean.thomas](https://forum.inductiveautomation.com/u/damean.thomas)\
**Post date:** [August 22, 2019, 10:18pm UTC](https://forum.inductiveautomation.com/t/triggered-transacting-group/27690/3 "2019-08-22T22:18:25Z")

</div>

I use this window in a project in project that is used on multiple machines using indirect tags. Is each window was in its own namespace.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 22, 2019, 11:44pm UTC](https://forum.inductiveautomation.com/t/triggered-transacting-group/27690/4 "2019-08-22T23:44:08Z")

</div>

> [@damean.thomas](#):
>
> Is each window was in its own namespace.

Doesn't matter. You are asking for trouble. Don't use tags as temporary locations for user input.

---

<div class="post-metadata">

**Author:** ![damean.thomas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/damean.thomas/32/11367_2.png) [@damean.thomas](https://forum.inductiveautomation.com/u/damean.thomas)\
**Post date:** [August 23, 2019, 1:34am UTC](https://forum.inductiveautomation.com/t/triggered-transacting-group/27690/5 "2019-08-23T01:34:33Z")

</div>

Thank you, I will revise the window.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 23, 2019, 2:50pm UTC](https://forum.inductiveautomation.com/t/triggered-transacting-group/27690/6 "2019-08-23T14:50:00Z")

</div>

You can use an expression binding on the text fields with a constant empty string to clear them automatically every time the window opens. A constant binding only runs once, then the user can edit as normal. Your validation then only needs to check for non-empty strings.
