set default value

amatost

Amato Sticca
What is the right method to give a set value to a field in an insertion of a new record, taken from another table?

Thanks.
 
ok, I tried it and it works, but if I put another field using the same type "databasejoin" with the same parameters is in error.
It 'a bug?
 
Well, yes, errors are always due to bugs. :)

But in this case, I suspect the bug is in your code, not ours. And we can't really spend much time debugging custom code in Community support.

You can paste your code here and if one of us has some time, we'll take a look. However, for support with custom coding, you really need to take out a paid subscription.

-- hugh
 
Hi,

I'm sorry but I have no custom code, the only thing is that I put a filter in the "Data - Where" in "Join where and / or order by statement (SQL)"

code is this:
WHERE fcw_giocatori.gt_ruolo = 'P' ORDER BY fcw_giocatori.gt_nome ASC

if I put it in one field it works perfectly, but if I put it in another field in the same form with the same databasejoin then gives error 1054.

regarding the payment of support, I quite agree, but when I'm losing a lot of time to assess whether fabrik product is right for me, then I will pay gladly support.
Meanwhile, I think the time I'm losing to solve my problems may serve both to grow the product is to help the community.

thanks in advance for the help you want to lend.
 
That is "custom code". Any code you introduce, whether it's PHP or MySQL, is "custom code".

Did you read the tooltip?

Filter the results of the database join, when rendering in the form, by entering an SQL where and/or order by statement - e.g. 'WHERE published = 1 ORDER BY time_date DESC'. If you get unexpected results, usually if you have more than one join or cascade element referencing the same table, prepend your field names with {thistable}, e.q. WHERE {thistable}.foo = 'bar'. NOTE that this wil NOT be applied to the list in the popup window when using the Front End Select feature."

Although I can't guarantee the tooltip has been translated correctly in all languages, I'm pretty sure it's correct in all the major ones.

The wiki is useful too ...

http://fabrikar.com/forums/index.php?wiki/database-join-element/#data-where

As for "losing a lot of time" assessing Fabrik ... it cuts both ways. By asking questions in Community forums, you are expecting other people to donate their time to help you save your time. I'm not sure what value you place on your time, but a month's Standard sub is about $25 USD, and usually pays for itself pretty quickly in your time saved. And helps pay for the time we spend helping you. I'm not trying to be an ass, I'm just trying to make a living. The reason I remind people about taking out a sub is that we have historically done as much Community support as we can, but as a result, we kind of kill the golden goose, as people then don't feel like they need to pay for support. So it's a balancing act. We want to help, but we also have to pay our rent. :)

-- hugh
 
you're asking me to pay for only two post I made, I assume that there are about 30 years I work in information technology, and I have so much respect for people like you, because I've been there, but I never asked . I only put 2 post to better evaluate the product in any case if the product is good I am willing to donate more than $ 25.

Thanks for all

PS.:
To our readers I have solved simply with this syntax:
WHERE `gt_ruolo` = 'P'
They were put quotes, even without the need to tablename.
 
The quotes aren't what fixed it, although it's always good practice to use them. What fixed it is not prepending the table name. Which is fine in simple where clauses, but sometimes you need to use it in more complex clauses. But if you do need to, you have to use {thistable} rather than the literal table name, in order to avoid issues with aliases, as described in the wiki.

Hugh


Sent from my HTC One using Tapatalk
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top