# Client can not save data but in ignition design it saved

**URL:** <https://forum.inductiveautomation.com/t/client-can-not-save-data-but-in-ignition-design-it-saved/11767>\
**Category:** Ignition\
**Created:** [June 2, 2016, 1:37am UTC](https://forum.inductiveautomation.com/t/client-can-not-save-data-but-in-ignition-design-it-saved/11767 "2016-06-02T01:37:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![trishhiyah](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@trishhiyah](https://forum.inductiveautomation.com/u/trishhiyah)\
**Post date:** [June 2, 2016, 1:37am UTC](https://forum.inductiveautomation.com/t/client-can-not-save-data-but-in-ignition-design-it-saved/11767/1 "2016-06-02T01:37:40Z")

</div>

Has anyone experience this problem that client can not save the data but when I tested it on the ignition design it saved the data correctly?

I tried to add an entry in OOS Technician Log using the client system, after entering this action taken, it doesn’t save, but when I tested it on the ignition design it save. Does anyone one know the conflict in client and ignition design?

Thanks

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [June 2, 2016, 1:53am UTC](https://forum.inductiveautomation.com/t/client-can-not-save-data-but-in-ignition-design-it-saved/11767/2 "2016-06-02T01:53:42Z")

</div>

save what data?

---

<div class="post-metadata">

**Author:** ![trishhiyah](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@trishhiyah](https://forum.inductiveautomation.com/u/trishhiyah)\
**Post date:** [June 2, 2016, 1:55am UTC](https://forum.inductiveautomation.com/t/client-can-not-save-data-but-in-ignition-design-it-saved/11767/3 "2016-06-02T01:55:00Z")

</div>

just the text in the database

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [June 2, 2016, 2:03am UTC](https://forum.inductiveautomation.com/t/client-can-not-save-data-but-in-ignition-design-it-saved/11767/4 "2016-06-02T02:03:56Z")

</div>

post your script so people can help.

---

<div class="post-metadata">

**Author:** ![trishhiyah](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@trishhiyah](https://forum.inductiveautomation.com/u/trishhiyah)\
**Post date:** [June 2, 2016, 2:12am UTC](https://forum.inductiveautomation.com/t/client-can-not-save-data-but-in-ignition-design-it-saved/11767/5 "2016-06-02T02:12:15Z")

</div>

here it is thanks in advance

p.s it works before the suddenly we encountered the problem. is there any problem in client timing?

[code]import sys

data = system.dataset.toPyDataSet(event.source.tbTechData)  
Technicians = 0  
Technicians\_IDs = “”

for row in data:  
if row[“Selected”] == 1:  
Technicians = Technicians + 1

if Technicians == 0:  
system.gui.messageBox(“You must select at least one technician.”)  
sys.exit()  
elif event.source.parent.getComponent(‘txtActionTaken’).text == ‘’:  
system.gui.messageBox(“You must enter a action taken for this record.”)  
sys.exit()  
else:  
for row in data:  
if row[“Selected”] == 1:  
if Technicians\_IDs != “”:  
Technicians\_IDs = Technicians\_IDs + ", " + str(row[“Technician\_ID”])  
else:  
Technicians\_IDs = str(row[“Technician\_ID”])

OOS\_Tech\_Log\_ID = event.source.parent.OOS\_Tech\_Log\_ID  
Line\_ID = event.source.parent.Line\_ID  
Machine\_ID = event.source.parent.Machine\_ID  
Variable\_ID = event.source.parent.Variable\_ID  
OOS\_IDs = event.source.parent.OOS\_IDs  
OOS\_Type = event.source.parent.OOS\_Type  
Root\_Cause = event.source.parent.Root\_Cause  
#Root\_Cause = event.source.parent.getComponent(‘txtRootCause’).text  
Action\_Taken = event.source.parent.Action\_Taken  
#Action\_Taken = event.source.parent.getComponent(‘txtActionTaken’).text  
Tech\_Start\_DT = event.source.parent.Start\_Date  
Tech\_End\_DT = event.source.parent.Completed\_Date  
Completed = event.source.parent.Completed

#Insert/Update record into Maintenance\_Calls  
call = system.db.createSProcCall(“usp\_OOS\_Tech\_Log\_Action\_Copy”)  
call.registerInParam(1, system.db.VARCHAR, OOS\_Tech\_Log\_ID ) #OOS\_Tech\_Log\_ID  
call.registerInParam(2, system.db.TINYINT, Line\_ID) #Line\_ID  
call.registerInParam(3, system.db.TINYINT, Machine\_ID) #Machine\_ID  
call.registerInParam(4, system.db.INTEGER, Variable\_ID) #Variable\_ID  
call.registerInParam(5, system.db.VARCHAR, OOS\_IDs) #OOS\_IDS  
call.registerInParam(6, system.db.VARCHAR, OOS\_Type) #OOS\_Type  
call.registerInParam(7, system.db.VARCHAR, Root\_Cause) #Root\_Cause  
call.registerInParam(8, system.db.VARCHAR, Action\_Taken) #Action\_Taken  
call.registerInParam(9, system.db.TIMESTAMP, Tech\_Start\_DT) #Tech\_Start\_DT  
call.registerInParam(10, system.db.TIMESTAMP, Tech\_End\_DT) #Tech\_End\_DT  
call.registerInParam(11, system.db.BOOLEAN, Completed) #Completed  
call.registerInParam(12, system.db.VARCHAR, Technicians\_IDs)   
system.db.execSProcCall(call)

system.gui.messageBox(“Record has been saved.”)  
event.source.parent.Action\_Taken = “”  
#event.source.parent.getComponent(‘txtActionTaken’).text = “”  
event.source.parent.Variable\_Name=""  
#event.source.parent.getComponent(‘txtRootCause’).text =""  
event.source.parent.Root\_Cause = “”  
Previous\_Window = event.source.parent.Previous\_Window  
window = system.gui.getWindow(Previous\_Window)  
table = window.getRootContainer().getComponent(‘Table’)  
table\_bit = window.getRootContainer().getComponent(‘Table\_Bit’)  
system.db.refresh(table, “data”)  
system.db.refresh(table\_bit, “data”)  
system.nav.closeParentWindow(event)  
system.nav.centerWindow(window)

```
[/code]
```

---

<div class="post-metadata">

**Author:** ![trishhiyah](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@trishhiyah](https://forum.inductiveautomation.com/u/trishhiyah)\
**Post date:** [June 2, 2016, 2:19am UTC](https://forum.inductiveautomation.com/t/client-can-not-save-data-but-in-ignition-design-it-saved/11767/6 "2016-06-02T02:19:18Z")

</div>

there is an error after publishing this window  
Exception: Error running query:  
SQLQuery(query=EXEC usp\_OOS\_History\_Get\_Copy  
‘2016-06-02 00:00:00’,  
1,  
0,  
‘’, database=)@5000ms  
On: OOS\_List.Root Container.Table.data  
caused by GatewayException: Connection Error: The database connection ‘PMON’ is FAULTED. See Gateway Status for details.  
caused by FaultedDatabaseConnectionException: The database connection ‘PMON’ is FAULTED. See Gateway Status for details.

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [June 9, 2016, 10:34pm UTC](https://forum.inductiveautomation.com/t/client-can-not-save-data-but-in-ignition-design-it-saved/11767/7 "2016-06-09T22:34:17Z")

</div>

That error tells us the DB connection in the gateway is faulted. You can go to the gateway homepage via your web browser and select status database connections and there should be a fault listed if the connection is still faulted. What is the fault?
