Hi,
On simple forms--forms without lookups or subforms, I have Text objects with the Default value SQL field filled. The default value shows up fine. On more complicated forms, the very same fields' default values won't show up.
I'm sorry this is so vague, but I don't know what information might be helpful.
Any idea what could be causing this?
Thank you,
Cassidy
Welcome to the nuBuilder forums!
Please register and login to view forums and other content only available to registered users.
Please register and login to view forums and other content only available to registered users.
Default value SQL in Text object works only on some forms
-
- Posts: 14
- Joined: Tue Apr 02, 2013 8:49 pm
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
Re: Default value SQL in Text object works only on some form
Cassidy,
maybe, table schema and/or the SQL code (right and wrong) might be helpful.crush wrote:... but I don't know what information might be helpful.
-
- Posts: 14
- Joined: Tue Apr 02, 2013 8:49 pm
Re: Default value SQL in Text object works only on some form
And the plot thickens...
It isn't the form that dictates if the value will show up. Turns out, if shows up on new entries, but not entries that already exist. Doesn't matter what the SQL is. I used
It isn't the form that dictates if the value will show up. Turns out, if shows up on new entries, but not entries that already exist. Doesn't matter what the SQL is. I used
Code: Select all
SELECT 'foo'[/SQL] in a Text object, FYI.
Any ideas why this is? Or how to get around it?
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
Re: Default value SQL in Text object works only on some form
Cassidy,
on text objects Defult Value SQL is executed only when a new record is created.
If you open an existing record this SQL isn't executed, also if the field is empty.
If you want to fill a empty text field on existing records you could use javascript/jQuery in Custom Code > Javascript nuLoadThis() function.
Another way, insert SQL in Text object > All tab > SQL Run Before Display
Hope this make sense.
on text objects Defult Value SQL is executed only when a new record is created.
If you open an existing record this SQL isn't executed, also if the field is empty.
If you want to fill a empty text field on existing records you could use javascript/jQuery in Custom Code > Javascript nuLoadThis() function.
Another way, insert SQL in Text object > All tab > SQL Run Before Display
Hope this make sense.
-
- Posts: 14
- Joined: Tue Apr 02, 2013 8:49 pm
Re: Default value SQL in Text object works only on some form
Thank you Max for that clarification.
Let's develop the SQL Run Before Display method. So say I want 'foo' to display in a text field every time the form is loaded. Just putting into SQL Run Before Display doesn't do the trick. I know this is easy to do with nuLoadThis(), but I want to know how to do it with SQL Run Before Display to do more advance stuff.
What would I have to do?
Let's develop the SQL Run Before Display method. So say I want 'foo' to display in a text field every time the form is loaded. Just putting
Code: Select all
SELECT 'foo'
What would I have to do?
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
Re: Default value SQL in Text object works only on some form
Cassidy,
I have explained myself badly: in SQL Run Before Display field you can specify SQL statement(s) that are run before object is created.
You can create a temp file, update other tables, use hash variables, or whatever you want, but the result is not displayed on the object.
For some usage examples execute this SQL on samplenufinancial database:
I hope I have been more clear.
Max
I have explained myself badly: in SQL Run Before Display field you can specify SQL statement(s) that are run before object is created.
You can create a temp file, update other tables, use hash variables, or whatever you want, but the result is not displayed on the object.
For some usage examples execute this SQL on samplenufinancial database:
Code: Select all
SELECT * FROM `zzsys_object` WHERE `sob_all_sql_run_before_display` <> ''
Max