Isuniquevalue with 2 conditions in 2 tables

What is the point of me writing code for you and saying use [0] if you disregard that and make me have to spend even more time explaining.

{gpexpedient ___ gp_exp_hab} is an SQL CONCAT of three columns using " | " as a separator.

The explode using " | " separates these back into the three parts. [0] is the first of these parts which is gp_hab_tipusinmoble. And this is what we want to test for "habitatge".

It is NOT "returning only the label". The label is ... well ... the label which is displayed regardless of what is returned. It is returning "" because [5] is empty.

I am afraid I have done as much as I can for you with this.
Sorry ... I am aware that I am a little heavy and quite limited.
I also tried with [0] ... I thought it was referring to the table ... sorry ...
One last question I want to ask you ... and I do not bother anymore with this topic.
Is it possible to show the value it returns using an "echo" or printf?
I would like to check that it returns the value per screen ...
nothing else...
thanks for continuing to help me
 
OK - we still have a problem - which is that areuniquevalues needs to have a set of fields to be unique in the table, and you don't have a field containing just habitatge / aparcament.

So you need to create a hidden calc element that contains that (from the {expedient___gp_exp_hab} field).
PHP:
return explode(' | ', '{expedient___gp_exp_hab}')[0];
  • Explode splits the string into an array containing the original columns.
  • [0] selects the first element of this array
So now you need to set the areuniquevalues on the calc element and / or the expendient___gp_exp_sol element with the condition:
PHP:
if ('{expedient___calc_name}' == 'habitatge')
{
    return true;
}
return false;

Hope this works for you.
Good
I've tried your code from the ' calc ' element and it works perfectly.
:)
Records the correct value "Habitatge" or "aparcament" in the record list
I've been hallucinating.
I wanted to thank you again for helping me.
Since yesterday I have been trying to run the validation correctly... but it does not work yet well.:oops:
if ('{gpexpedient___gp_exp_calc}' == 'habitatge')
{
return true;
}
else {
return false;
}

I'll keep trying... if I get it notice.:rolleyes:
Unaware of the potential of the "Calc element"
Thanks again for the brilliant ideas and for being there always!
 
Last edited:
Good?
I already found my error ...:)
I mention it in case someone ever happens to him.
This element calc extracts the first value [0]
return explode ('|', '{expedient ___ gp_exp_hab}') [0];
it turns out that the element gp_exp_hab, showed it with a concatenation ...
gphabitatge.gp_hab_adreca, '
| ', gphabitatge.gp_hab_tipusinmoble,'
| ', gphabitatge.gp_hab_user

And I could not do well the comparison of the validation "isuniquevalue" ... since Return explode returned "habitatge ":( "Habitatge and five spaces of the concatenation") visually on the table these spaces were not appreciated ...
if ('{gpexpedient___gp_exp_calc}' == "habitatge")
{
return true;
}
else {
return false;
}


A thousand thanks for the support and time dedicated ... and for making me discover, new elements of fabrik that I completely ignored.:D:D
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top