# Help with data entry form

**URL:** <https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [January 9, 2023, 3:46am UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440 "2023-01-09T03:46:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kavya\_shree](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kavya\_shree](https://forum.inductiveautomation.com/u/kavya_shree)\
**Post date:** [January 9, 2023, 3:46am UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/1 "2023-01-09T03:46:12Z")

</div>

Hi,  
I have entry screen. I inserting data into database. after insertion, if I select any line from drop down which is already there in database I am showing error message and after clicking OK button on message box , it should get all its corresponding data automatically on the components.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/2/92a96b3c82d1bf58c6a5ee4006cb5f9fb5d00085.png)  
on Assign button , inserting.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/8/88b7463f1b345e3bbbc3c5ef8243c5ce7ec9fb84.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/e/3ef4137e313fc1aea24c94b1b1529de68553d460.png)

after clicking on OK, I am not getting its value/ not able filter the data.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/6/b67b89e0531205455c1f1219995598641ba872d7.png)

I am not using any table in screen.  
please help me out in this.

Thank you

---

<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:** [January 9, 2023, 1:51pm UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/2 "2023-01-09T13:51:14Z")

</div>

Find that code that is showing that error. That is not a native Ignition error. Fix the code you find. (Or post all relevant code here for us to help. Do not post screen shots. Post pre-formatted text.)

---

<div class="post-metadata">

**Author:** ![kavya\_shree](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kavya\_shree](https://forum.inductiveautomation.com/u/kavya_shree)\
**Post date:** [January 10, 2023, 3:27am UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/3 "2023-01-10T03:27:12Z")

</div>

here its code on Assign BUTTON.

```auto
line = event.source.parent.getComponent('select line').selectedStringValue
sapordernum = event.source.parent.getComponent('sapordernumber').selectedStringValue
partnumber = event.source.parent.getComponent('select partnum').selectedStringValue
status = event.source.parent.getComponent('status').selectedStringValue
starttime = event.source.parent.getComponent('startdate ').text
machineid = event.source.parent.getComponent('machineID').text
endtime = event.source.parent.getComponent('end date').text

if event.source.parent.getComponent('select line').selectedStringValue == "":
	system.gui.messageBox("Please Select Line")
    
table = system.db.runQuery("select LINE,Status from dbo.[RAPTOR_LINECHANGE_ASSIGNMENT] where LINE='"+line+"'")
if len(table)>0:
	for row in table:
	    status = row["Status"]
	    print status	    
	    if status == 'Completed':
	    	system.gui.messageBox("Already Line is Assigned.")	
	    	break    	
	    else:
	     try:
	       system.gui.messageBox("after try message box.")
	       print "abcds"
	       system.db.runQuery("update RAPTOR_LINECHANGE_ASSIGNMENT set Status ='Completed', EndTime='"+endtime+"' where LINE='"+line+"'")
	       system.gui.messageBox("Line Updated Successfully.")
	       break
	     except :
	   		system.gui.messageBox("Line is not present.")	
	   	
#else:       
elif event.source.parent.getComponent('status').selectedStringValue == "In Progress":
    #event.source.parent.getComponent('status').selectedLabel == "In Progress":
	event.source.parent.getComponent('end date').text == "NULL"
	system.db.runNamedQuery("Insert_Line_Assignment",{"LINE":line, "MACHINEID":machineid, "SAPOrderNum":sapordernum, "PartNumber":partnumber, "Status":status, "StartTime":starttime})
	l = system.db.runScalarQuery("SELECT LINE FROM dbo.[RAPTOR_LINECHANGE_ASSIGNMENT] WHERE SAPOrderNum='"+sapordernum+"'")
	system.gui.messageBox("The selected line is: %s" %l)
	
	
	
	
#	count = system.db.runQuery("SELECT COUNT(*) FROM [dbo].[RAPTOR_LINECHANGE_ASSIGNMENT] WHERE SAPOrderNum='"+sapordernum+"'")
#	system.gui.messageBox("'%sapordernum',count") 
#	print count
	system.gui.messageBox("Order Assigned Successfully.")  
#if len(table)>0:
# system.gui.messageBox("Order Assigned Successfully.")
    #break
event.source.parent.getComponent('sapordernumber').selectedValue = -1
event.source.parent.getComponent('select line').selectedValue = -1
event.source.parent.getComponent('select partnum').selectedValue = -1
event.source.parent.getComponent('status').selectedValue = -1
system.gui.messageBox("Order Assigned Successfully.")

```

here is the code on Selected Line dropdown, on property Change event

```auto
if event.propertyName == "selectedStringValue":
	selNewValue = event.newValue
	print selNewValue
	
	selectedLine = event.source.selectedStringValue
	selectedStatus = event.source.parent.getComponent('status').selectedStringValue
	#print selectedLine
	#table = system.db.runQuery("select top 1 MACHINEID,SAPOrderNum,PartNumber,Status,StartTime from [dbo].[RAPTOR_LINECHANGE_ASSIGNMENT] where LINE = '"+selectedLine+".strip()' order by StartTime desc")
	table = system.db.runQuery("select top 1 MACHINEID,SAPOrderNum,PartNumber,Status,StartTime from [dbo].[RAPTOR_LINECHANGE_ASSIGNMENT] where LINE ='"+selectedLine+"' order by StartTime desc")
	#table = system.db.runQuery("select top 1 MACHINEID,SAPOrderNum,PartNumber,Status,StartTime from [dbo].[RAPTOR_LINECHANGE_ASSIGNMENT] where LINE='"+selectedIndex+"' order by StartTime desc")
	for row in table:
	    machineid = row["MACHINEID"]
	    sapordernumber = row["SAPOrderNum"]
	    partnum = row["PartNumber"]
	    status = row["Status"]
	    starttime = row["StartTime"]
	     #date = dateFormat(starttime, 'yyyy-MM-dd 00:00:00')
	    print starttime
	    print status
	
	    if status == 'Completed' and selectedLine == row["LINE"]:
	   		system.gui.messageBox("Line is Comlpleted")
	   		break
	    else:
			system.gui.messageBox("The Line is in Progress,Please Comlplete")
			break
			event.source.parent.getComponent('machineID').text = machineid
			break
			event.source.parent.getComponent('select partnum').selectedStringValue = partnum
			break
			event.source.parent.getComponent('status').selectedLabel = status
			#event.source.parent.getComponent('status').selectedStringValue = status
			break
			print status
			break
			event.source.parent.getComponent('startdate ').text = "2022-12-29 01:00:00"
			break
			
							

```

Thank you

---

<div class="post-metadata">

**Author:** ![kavya\_shree](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kavya\_shree](https://forum.inductiveautomation.com/u/kavya_shree)\
**Post date:** [January 10, 2023, 9:05am UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/4 "2023-01-10T09:05:41Z")

</div>

> [@Need help with Form style Data Entry UI](https://forum.inductiveautomation.com/t/need-help-with-form-style-data-entry-ui/3335/2):
>
> ly bind them to an expression

Even I have doubt on this.

I have first dropdown and text fields in my screen.  
I using all these input fields to insert data into database.  
[![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/3/93233e0adbf4192be3f236d4ed1285f45a9dfb12.png) ](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/3/93233e0adbf4192be3f236d4ed1285f45a9dfb12.png)

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/3/7387bfa346221b9ca35c9ff1386366d746750b7a.png)

after selecting line from dropdown, example : R22  
since it is already in database, user is unable to insert same line. so I am showing message box.  
after clicking on OK on message box,  
I want all column values to be auto populated from database table.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 10, 2023, 9:18am UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/5 "2023-01-10T09:18:01Z")

</div>

> [@kavya\_shree](#):
>
> I am showing message box.  
> after clicking on OK on message box,  
> I want all column values to be auto populated

A few questions:  
• What kind of message box are you using for this? Is it a system.gui.confirm, a JOptionPane, or an ignition popup window?

• Where are you firing the script from that is supposed to populate everything from the database?

• What code are you using to accomplish this task?

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/5/95df79b820d15a210f3a4654f364baee880ca15e.png)

---

<div class="post-metadata">

**Author:** ![kavya\_shree](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kavya\_shree](https://forum.inductiveautomation.com/u/kavya_shree)\
**Post date:** [January 10, 2023, 9:44am UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/6 "2023-01-10T09:44:48Z")

</div>

oh ok . I am using just giu.messageBox.  
Shall I use confirm message box.Then how I can write my code in confirm OK button,.  
please tell me the steps.

here for first dropdown, on property change Event, i have written the code like this:

```auto
if event.propertyName == "selectedStringValue":
	selNewValue = event.newValue
	print selNewValue
	
	selectedLine = event.source.selectedStringValue
	selectedStatus = event.source.parent.getComponent('status').selectedStringValue
	#print selectedLine
	#table = system.db.runQuery("select top 1 MACHINEID,SAPOrderNum,PartNumber,Status,StartTime from [dbo].[RAPTOR_LINECHANGE_ASSIGNMENT] where LINE = '"+selectedLine+".strip()' order by StartTime desc")
	table = system.db.runQuery("select top 1 MACHINEID,SAPOrderNum,PartNumber,Status,StartTime from [dbo].[RAPTOR_LINECHANGE_ASSIGNMENT] where LINE ='"+selectedLine+"' order by StartTime desc")
	
	for row in table:
	    machineid = row["MACHINEID"]
	    sapordernumber = row["SAPOrderNum"]
	    partnum = row["PartNumber"]
	    status = row["Status"]
	    starttime = row["StartTime"]
	     #date = dateFormat(starttime, 'yyyy-MM-dd 00:00:00')
	    print starttime
	    print status
	
	    if status == 'Completed' and selectedLine == row["LINE"]:
	   		system.gui.messageBox("Line is Comlpleted")
	   		break
	    else:
			system.gui.messageBox("The Line is in Progress,Please Comlplete")
			break
			event.source.parent.getComponent('machineID').text = machineid
			break
			event.source.parent.getComponent('select partnum').selectedStringValue = partnum
			break
			event.source.parent.getComponent('status').selectedLabel = status
			#event.source.parent.getComponent('status').selectedStringValue = status
			break
			print status
			break
			event.source.parent.getComponent('startdate ').text = "2022-12-29 01:00:00"
			break
			
							

```

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 10, 2023, 9:51am UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/7 "2023-01-10T09:51:01Z")

</div>

Some people shy away from any kind of system.gui messaging because it locks the gui thread, but even if that doesn't matter to you, switching to system.gui.confirm is probably not necessary for your usage case. Try adjusting the `break` lines in your code. Once your thread hits one of those, nothing more will happen. In the above code example, the messagebox shows, and the thread terminates at the first `break` before any string values get populated. Furthermore, there is no possibility of the loop running for more than one iteration.

Another approach would be to use warning labels next to the improperly populated fields instead of using a popup.

---

<div class="post-metadata">

**Author:** ![kavya\_shree](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kavya\_shree](https://forum.inductiveautomation.com/u/kavya_shree)\
**Post date:** [January 10, 2023, 10:06am UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/8 "2023-01-10T10:06:37Z")

</div>

> [@justinedwards.jle](#):
>
> warning labels next to

ya I just removed the break. after checking message box its working . all fields are getting auto populating.  
and In same way to disable all fields after auto populating.  
Thank you, Thank you so much

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 10, 2023, 10:19am UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/9 "2023-01-10T10:19:34Z")

</div>

There's absolutely no chance this does what you think it does.

To make it simple, `break` stops the execution of the current loop.  
Which means that once a `break` is encountered, nothing that comes immediately afterward on the same level of indentation will NOT be executed.  
Here, in your `else` clause, only the first line will EVER be executed, as it is followed by a `break`.  
Not only that, but only the first iteration of the loop will ever be executed, since both `if` and `else` have an unconditional break in them. Which makes the whole loop be... not a loop.

If you tell us what you want this code to do, I'll rewrite it for you. And explain along the way how it works.

If you describe precisely (throw in an example so we can be sure we're understanding each other) what you're trying to achieve, we might even figure out a better way than a change script, and remove that code entirely.

edit: Here's a quick simplification of the code you posted above.

```python
if event.propertyName == "selectedStringValue":
	selNewValue = event.newValue
	selectedLine = event.source.selectedStringValue
	selectedStatus = event.source.parent.getComponent('status').selectedStringValue

	query = """
	select top 1 MACHINEID, SAPOrderNum, PartNumber, Status, StartTime
	from [dbo].[RAPTOR_LINECHANGE_ASSIGNMENT]
	where LINE = '{}'
	order by StartTime desc
	limit 1
	""".format(selectedLine)
	table = system.db.runQuery(query)
	
	machineid, sapordernumber, partnum, status, starttime = table[0]

	if status == 'Completed':
		system.gui.messageBox("Line is Comlpleted")
	else:
		system.gui.messageBox("The Line is in Progress,Please Comlplete")
		event.source.parent.getComponent('machineID').text = machineid
		event.source.parent.getComponent('select partnum').selectedStringValue = partnum
		event.source.parent.getComponent('status').selectedLabel = status
		event.source.parent.getComponent('startdate ').text = "2022-12-29 01:00:00"

```

note: No logic has been changed, it's only a simplification  
So, what changed ?

- since only the first iteration of the loop was ever executed, I removed it. Which means the `break`s are gone too.
- since only the first row of the table was used, I added `limit 1` to the query.
- took the query text out of the function call and used `.format` instead of string concatenation, so it was easier to see that the only change there was the addition of `limit 1`. Put it back into the function call if you want it to be just one line.
- grouped together the variable assignations and let `table[0]` unpack itself.
- removed ` and selectedLine == row["LINE"]` from the condition since it can only be true:  
The query makes sure only the rows where `LINE == selectedLine` are included.

---

<div class="post-metadata">

**Author:** ![kavya\_shree](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kavya\_shree](https://forum.inductiveautomation.com/u/kavya_shree)\
**Post date:** [January 10, 2023, 10:51am UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/10 "2023-01-10T10:51:22Z")

</div>

Thank you so much, I learnt many things.

I just copy pasted your code. its giving following error.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f7ab54491fff26223f3637719a5b215cc9123fe8.png)

On Assign Button, I am inserting if line is not there in database.  
if line is there and its status is "In Progress", I am updated to "Completed"  
please check this also.  
if I finish this screen, it will be a great help .  
on Assign Button Code:

```auto
line = event.source.parent.getComponent('select line').selectedStringValue
sapordernum = event.source.parent.getComponent('sapordernumber').selectedStringValue
partnumber = event.source.parent.getComponent('select partnum').selectedStringValue
status = event.source.parent.getComponent('status').selectedStringValue
starttime = event.source.parent.getComponent('startdate ').text
machineid = event.source.parent.getComponent('machineID').text
endtime = event.source.parent.getComponent('end date').text

if event.source.parent.getComponent('select line').selectedStringValue == "":
	system.gui.messageBox("Please Select Line")
    
table = system.db.runQuery("select LINE,Status from dbo.[RAPTOR_LINECHANGE_ASSIGNMENT] where LINE='"+line+"'")
if len(table)>0:
	for row in table:
	    status = row["Status"]
	    print status	    
	    if status == 'Completed':
	    	system.gui.messageBox("Already Line is Assigned.")	
	    	break    	
	    else:
	     try:
	       system.gui.messageBox("after try block, just checking try blocking is working .")
	       system.db.runUpdateQuery("update RAPTOR_LINECHANGE_ASSIGNMENT set Status ='Completed', EndTime='"+endtime+"' where LINE='"+line+"'")
	       #system.db.runQuery("update RAPTOR_LINECHANGE_ASSIGNMENT set Status ='Completed', EndTime='"+endtime+"' where LINE='"+line+"'")
	       system.gui.messageBox("Line Updated Successfully.")
	       break
	     except :
	   		system.gui.messageBox("Line is not present.")	
	   	
#else:       
elif event.source.parent.getComponent('status').selectedStringValue == "In Progress":
    #event.source.parent.getComponent('status').selectedLabel == "In Progress":
	event.source.parent.getComponent('end date').text == "NULL"
	system.db.runNamedQuery("Insert_Line_Assignment",{"LINE":line, "MACHINEID":machineid, "SAPOrderNum":sapordernum, "PartNumber":partnumber, "Status":status, "StartTime":starttime})
#	l = system.db.runScalarQuery("SELECT LINE FROM dbo.[RAPTOR_LINECHANGE_ASSIGNMENT] WHERE SAPOrderNum='"+sapordernum+"'")
#	system.gui.messageBox("The selected line is: %s" %l)
	system.gui.messageBox("Order Assigned Successfully.")  

event.source.parent.getComponent('sapordernumber').selectedValue = -1
event.source.parent.getComponent('select line').selectedValue = -1
event.source.parent.getComponent('select partnum').selectedValue = -1
event.source.parent.getComponent('status').selectedValue = -1

```

after selected same line, If line , Status Completed also message showing message box Line is in progress,  
it should show line completed.

please check where I am missing

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 10, 2023, 11:01am UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/11 "2023-01-10T11:01:29Z")

</div>

One more thing:  
the variables `selNewValue` and `selectedStatus` declared at the beginning are not used. You can remove them if you don't plan on using them.

---

<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:** [January 10, 2023, 2:00pm UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/12 "2023-01-10T14:00:06Z")

</div>

So, the unexpected message is in your propertyChange event. A brief review suggests you have way too much scripting--scripting that should be a few bindings. Also, I strongly recommend **NOT** using message boxes--they freeze your UI. I also strongly recommend you stop constructing SQL for `.runQuery()` by concatenating values into quotes strings. Use a Named Query, or if you must, use `.runPrepQuery()` with proper substitutions.

Anyways, I recommend the following:

- Make a non-caching Named Query with

```auto
Select tTop 1 MACHINEID, SAPOrderNum, PartNumber, Status, StartTime
From db.RAPTOR_LINECHANGE_ASSIGNMENT
Where LINE=:lineParam
Order By StartTime Desc

```

- On the dropdown component, add a custom dataset property `LineAssignment` and use the named query to make a binding to the above. Pass the dropdown's `.selectedStringValue` to the named query as the `lineParam` parameter.

- Make additional custom properties with datatypes matching the columnTypes of the above dataset. Bind to the row 0 value, wrapped in a `try()`, like so for `LineStatus`:

```auto
try({Root Container.Dropdown.LineAssignment}[0,'Status'], "")

```

- Add a label adjacent to the dropdown and bind its text to the dropdown's `LineStatus` property. This shows the use the current condition of that line. Style it according to the display value, if you like.

- Use the desired values in `LineStatus` in a binding to enable/disable the assignment button. That button will no longer need to check for a valid line in its `actionPerformed` event. After updating the line, use `system.db.refresh()` on the named query property to make it pick up the new values.

- Use additional bindings to provide initial values to the data entry fields.

---

<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:** [January 10, 2023, 2:06pm UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/13 "2023-01-10T14:06:18Z")

</div>

I just replied on your other topic, @kavya_shree.

[https://forum.inductiveautomation.com/t/dataset-filtering-on-dropdowns/61052/11?u=pturmel](https://forum.inductiveautomation.com/t/dataset-filtering-on-dropdowns/61052/11)

You should know that it is [against this forum's rules](https://forum.inductiveautomation.com/faq) to post the same question in multiple places. Your help is now fragmented. ):

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 10, 2023, 2:42pm UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/14 "2023-01-10T14:42:53Z")

</div>

My bad, I didn't see the `select top 1` in your query. Remove the `limit 1` I added.

That being said, you should do as Phil said in the other thread.  
As I stated in a previous post, "There might be a better way, which would make the whole script obsolete". Phil provided that better way.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 10, 2023, 5:29pm UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/15 "2023-01-10T17:29:12Z")

</div>

I've moved all the myriad posts into this one new thread.

---

<div class="post-metadata">

**Author:** ![kavya\_shree](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kavya\_shree](https://forum.inductiveautomation.com/u/kavya_shree)\
**Post date:** [January 11, 2023, 4:39am UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/16 "2023-01-11T04:39:31Z")

</div>

So sorry When I was searching for different issues, I added same issues because all it was related with each other.

Sorry for inconvenience. Thank you

---

<div class="post-metadata">

**Author:** ![kavya\_shree](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kavya\_shree](https://forum.inductiveautomation.com/u/kavya_shree)\
**Post date:** [January 31, 2023, 3:45am UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/17 "2023-01-31T03:45:03Z")

</div>

Thank you all, This screen is completed with validation.

---

<div class="post-metadata">

**Author:** ![Alan\_Cannon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alan_cannon/32/31171_2.png) [@Alan\_Cannon](https://forum.inductiveautomation.com/u/Alan_Cannon)\
**Post date:** [February 21, 2023, 3:16pm UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/18 "2023-02-21T15:16:14Z")

</div>

Morning Phil,  
is there a performance gain or loss by coding the Sql Syntax into a String then passing the result to the .runQuery() v.s using named queries.

---

<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:** [February 21, 2023, 4:33pm UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/19 "2023-02-21T16:33:52Z")

</div>

String conversions and manipulations are definitely slower, and prevent the JDBC driver from optimizing repeated queries. But that isn't the most important reason. Using string manipulation is how you get SQL injection vulnerabilities. Just don't. Use Named Queries, or in scripts, use "Prep" queries.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 21, 2023, 4:38pm UTC](https://forum.inductiveautomation.com/t/help-with-data-entry-form/68440/20 "2023-02-21T16:38:12Z")

</div>

Named queries also get easy access to caching, so you can trade memory for network traffic and CPU.
