Page 1 of 1

Long Field Names in Grid Data Properties Window

Posted: Fri Feb 12, 2021 10:42 am
by RichDotsonMTD
Is there a way to use the long field names when linking a database to a widget? I have the "Enable Long Field Names through Aliases" option selected in the designer but that seems to only affect individual fields on the UI. When I prompt the "database fields" property the field selection window shows the short names or creates a 10 character field name if the field in the DB is longer than 10 characters.
.
.

Re: Long Field Names in Grid Data Properties Window

Posted: Fri Feb 12, 2021 11:02 am
by Scott Klement
To be clear: There are two different (unrelated) things referenced in this post:
  1. Variables for in RPG/DDS "field binding" via the "Enable Long Field Names through Aliases" option
  2. SQL database column names for a database-driven widget (the "database fields" property)
Please be careful to understand that these are different things.

That said, if your database has both longer and shorter field column names, you should be able to use the longer ones simply by typing them into the "database fields" property in place of the shorter ones. The "prompt window" for selecting fields may not show them, but that shouldn't matter. For database fields, all it is doing is building a SELECT statement, like:

Code: Select all

SELECT [database fields property] FROM [database file property]
So as long as the field names you type in the property would be valid in a SELECT statement, they should work fine.

Re: Long Field Names in Grid Data Properties Window

Posted: Fri Feb 12, 2021 12:36 pm
by RichDotsonMTD
I figured they were separate things based on the results I was seeing but wanted to verify that. I was hoping there was a setting that I was missing that would allow me to "toggle" between the short and long SQL column names like the "Enable Long Field Names through Aliases" does for the RPG/DDS variables.

Because of my horrendous typing skills I was trying to avoid typing each long column name into the "database fields" property. I've resorted to typing the column names into a Notepad++ document and then copy/pasting that string into the PUI designer. Not the most efficient process but much better than typing them into the small "database fields" property.

Thanks for the info. Your quick response is always appreciated.

Re: Long Field Names in Grid Data Properties Window

Posted: Fri Feb 12, 2021 4:24 pm
by RichDotsonMTD
I tried keying the long SQL column name into the "database fields" property but when I ran the program nothing was loaded into the grid. When I used the short DB names the grid loaded as expected.
.
.

Re: Long Field Names in Grid Data Properties Window

Posted: Fri Feb 12, 2021 4:47 pm
by Scott Klement
This may be a bug in the new "load fields into widgets" property -- which is the new feature that lets you use field binding together with a database-driven grids. (I'm assuming you don't have this problem when this property is turned off.)

When this feature is off, it does not require anything to be bound to widgets, the data is loaded directly into the grid itself, and since there's no binding, this should be a non-issue.

I'll ask the developer who wrote that feature to confirm.

Re: Long Field Names in Grid Data Properties Window

Posted: Fri Feb 12, 2021 5:00 pm
by RichDotsonMTD
You are correct. It works correctly if I turn off the "load fields into widgets" property.

I was able to get it to work correctly with the "load fields into widgets" property set to "true" by going into the source view and changing the "fieldName" from "RECENT0001" to "RecentOrder" which is the SQL long column name.

Re: Long Field Names in Grid Data Properties Window

Posted: Fri Feb 12, 2021 5:15 pm
by Scott Klement
Good to know. That being the case, its definitely a bug, and should be reported to Profound Logic by e-mailing support@profoundlogic.com

I can let them know.