servoy 4 calculation using value from database

Discuss all feature requests you have for a new Servoy versions here. Make sure to be clear about what you want, provide an example and indicate how important the feature is for you

servoy 4 calculation using value from database

Postby darthtall » Fri Jun 20, 2008 9:14 pm

var test_email = login + "@mydomain.com";
return test_email;

this code does not work????????????

login is a field in the table and has a value of fred.
the calculation above returns nothing

When I do this!

var test_email = utils.srtingtrim(login) + "@mydomain.com";
return test_email;
this calculation returns fred@mydomain.com;

is there a way to run the calculation without the trim?
Last edited by darthtall on Fri Jun 20, 2008 9:55 pm, edited 1 time in total.
darthtall
 
Posts: 6
Joined: Tue Jan 15, 2008 11:14 pm

Postby IT2Be » Fri Jun 20, 2008 9:48 pm

So, to completely understand.
Make sure that we help you with what really seems to be your problem...

You are trying to make a calculation work?
login is a column in your table?
login really exists and has a value?

Please, please be more specific!!!!
Many on the forum, if not all, try to help you voluntarily.
So help us to help you by asking a question instead of making a puzzle...

-- original post was edited by poster --
Last edited by IT2Be on Fri Jun 20, 2008 10:29 pm, edited 1 time in total.
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby IT2Be » Fri Jun 20, 2008 10:27 pm

what datatype is the calculation set to?
and what datatype has the column login?

btw I would always check that login is not null!
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

answer

Postby darthtall » Fri Jun 20, 2008 10:30 pm

the calculation is set to datatype text
the login column is text

how do you check for null before calculating?

thank you for you help
darthtall
 
Posts: 6
Joined: Tue Jan 15, 2008 11:14 pm

Postby IT2Be » Fri Jun 20, 2008 10:43 pm

Code: Select all
if (login == null) {

}
is ok or
Code: Select all
if (!login) {

}
will check that login is not null and not "" (or 0 if int/number)

Have you tested with only one record or more?

This really should work.

What when you re-enter 'fred'
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany


Return to Discuss Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest