You are viewing limited content. For full access, please sign in.

Question

Question

My Forms Lookup doesn't seem to be holding the Alphabetical Listing from the table??

asked on November 25, 2013

So I know there was another post similar to this, but I didn't see an answer to my specific question.  I've taken an Excel list (see screenshot) and have imported that list into SQL to create a database that I can use for my forms lookup.  The issue is when I select the County drop down...they're not in alphabetical order, even though they are in Excel and they appear to be in SQL (unless I'm looking in the wrong place in SQL).  I've attached also what my form looks like where it's not holding the alphabetical list.  Any ideas on what might be causing this and where I should be looking to correct it?

 

Thanks!

County list.PNG
Excel.PNG
Excel.PNG (117.18 KB)
0 0

Answer

APPROVED ANSWER
replied on November 26, 2013 Show version history

I also had the same issue and spoke to presales about it. They mentioned that there is no sorting in forms drop down list that is being populated by a lookup. The sort needs to happen from the database side. The work around I came up with was to use a view (http://en.wikipedia.org/wiki/View_%28SQL%29) that already sorts the information I need and use that as my look up table.

 

Hope this helps.

3 0
replied on November 26, 2013 Show version history

I'm stumped as I created a view using the following:

USE [EthicsMunicipalities]
GO
CREATE VIEW vCounty
AS
SELECT TOP(100) PERCENT [County],[Municipality]
FROM[dbo].[Adams$]
ORDER BY
[County]

 

However, when I go into Forms then...and attempt to do the lookup, my Counties are not in order??  I've attached a screenshot of my View from SQL and the Rule I created in Forms.  

 

Thanks!

List.PNG
rule.PNG
List.PNG (108.3 KB)
rule.PNG (41.25 KB)
0 0

Replies

replied on November 26, 2013

The issue is with the way SQL Server handles ORDER BY in View. Apply the following hotfix for SQL Server 2008: http://support.microsoft.com/default.aspx?scid=kb;en-us;926292&sd=rss&spid=2855

1 0
replied on November 26, 2013

I'm using SQL 2012, does that matter or still apply the same hotfix?

0 0
replied on November 26, 2013 Show version history

I don't know. A sure way of having this to work is for Laserfiche to add a sort feature for each look up. ORDER BY clause in View generally gets ignored by SQL Server. I'll wait for Laserfiche Developer response to see if any changes are coming on the new version of Forms that is coming out soon.

1 0
replied on December 6, 2013

Forms 9.1 will sort the look up result in alphabetic order from database if the look up is populating one field. If look up populates two or more fields, entries will be sorted by the first populated field. 

1 0
replied on November 26, 2013

Views can't use SORT BY even with a 100 percent. You could try 99.99 percent. you will lose a few rows of in the view but depending on your use it might be a use it as a work around. 

replied on November 26, 2013

SQL does not guarantee the order of results without an ORDER BY clause and like, Mohammad noted, it ignored ORDER BY in view definitions. Forms does not currently allow you to specify custom queries and we currently don't have plans to allow picking which columns to order the results on. However, Forms 9.1 will allow you to use stored procedures for lookup, so you will be able to get sorted results that way.

0 0
replied on November 26, 2013

So from what I'm hearing, there's not solution to my issue right now, we have to wait for Forms 9.1 to be released?

0 0
replied on November 26, 2013

That's correct

0 0
replied on November 27, 2013

Miruna,

Then just curious...why is it that my list is sorted properly in SQL, but does not show up that way in Forms?  That's why I'm struggling...I have two columns in SQL with lists....one being County the other Municipality.  When I chose a County, the Municipalities for that county are listed alphabetically, however, the County list is not in Forms, but it is in SQL.

0 0
replied on November 27, 2013

Forms is about to undergo a large revision. In it's current version it seems to use the SQL information exactly as it is received and as Miruna mentioned, SQL may not return the information exactly as you expect it or see it on your screen in another tool. 

0 0
replied on November 27, 2013

Kenneth,

Even as I run the SQL Query?  I'm not using any external tools, I'm running a simple query to display the information in the table...and when it's displayed, it's displays everything alphabetically by County?  Not trying to beat a dead horse here...but you said you had the same issue and were able to fix it by using a view...then why doesn't that work for me??

0 0
replied on November 27, 2013

forms isnt getting that information like that. dont know why, it just happens to be that whatever you are using to view that information is sorting it in some way, or that SQL when sending the information to another tool/service is just not returning the same information in the same order. 

0 0
replied on November 27, 2013

Let me ask you this...do you think it would have anything to do with the fact I have the Counties listed more than once?  Example:  I have Adams County listed 42 times because there are42 municipalties

 

Abbottstown Borough Adams County
Arendtsville Borough Adams County
Bendersville Borough Adams County
Bermudian Springs School District Adams County
Berwick Township Adams County
Biglerville Borough Adams County
Bonneaueville Borough Adams County
Butler Township Adams County
Carrol Valley Borough Adams County
Conewago Township Adams County
Conewago Valley School District Adams County
Cumberland Township Adams County
East Berlin Borough Adams County
Fairfield Area School District Adams County
Fairfield Borough Adams County
Franklin Township Adams County
Freedom Township Adams County
Germany Township Adams County
Gettysburg Area School District Adams County
Gettysburg Borough Adams County
Hamilton Township Adams County
Hamiltonban Township Adams County
Highland Township Adams County
Huntington Township Adams County
Latimore Township Adams County
Liberty Township Adams County
Lincoln Intermediate Unit 12 Adams County
Littlestown Area School District Adams County
Littlestown Borough Adams County
McSherrystown Borough Adams County
Menallen Township Adams County
Mount Joy Township Adams County
Mount Joy Township Adams County
New Oxford Borough Adams County
Oxford Township Adams County
Reading Township Adams County
Straban Township Adams County
Tyrone Township Adams County
Union Township Adams County
Upper Adams School District Adams County
York Springs Borough

Adams County

 

So with that being said...I would expect when I click on the County list in Forms that it would display Adams County 42 times...but it's only there once?  Also, as a workaround...is there a way I can just put the Counties in a Drop Down List in Forms...then perform the lookup for the List of Municipalties off that Field (similar to how RealTime lookup works)??   In other words...I chose Adams County from the Forms List (not a SQL table), and based upon the County I select, the list in Municipalties is pulled from the SQL Table?

0 0
replied on April 13, 2023

This was started in 2013. I have SMS v 19

Is there a hotfix or has anything changed in LF to assist with this dropdown listing ASC ORDER? 

Mohamad's link "Apply the following hotfix for SQL Server 2008:" did not work for me. 

0 0
replied on April 13, 2023

What version of Forms are you using?

0 0
replied on April 13, 2023

Laserfiche Forms Professional Version 10.4.5.331

0 0
replied on April 13, 2023

Yes, you set it when you are configuring your lookup rules.

2 0
replied on April 13, 2023

Perfect!! Thanks.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.