Binary conditional
Hi all!
I have a chronoconnectivity list with two columns:
“estado” with several possibilities, “pendiente” “asignado ”“completado” and other with a binary option “facturado”.
How I can make the “facturado” option is activated only if the state is equal to “completado”?
Thanks.
Pablo.
I have a chronoconnectivity list with two columns:

“estado” with several possibilities, “pendiente” “asignado ”“completado” and other with a binary option “facturado”.
How I can make the “facturado” option is activated only if the state is equal to “completado”?
Thanks.
Pablo.
Hi Pablo,
You can use the "PHP Functions" box to show the activated status by changing the value before its displayed, BUT this doesn't affect the database value under the table field "facturado".
In the PHP functions:
Regards,
Max
You can use the "PHP Functions" box to show the activated status by changing the value before its displayed, BUT this doesn't affect the database value under the table field "facturado".
In the PHP functions:
Model.facturado:return ($row["Model"]["estado"] == "completado") ? 1 : 0);
Regards,
Max
Thanks for help.
I don’t need change any value, only I want that “facturado” button is blocked or disappear in case that column “estado” <> “Completado”.
In binary box: model.facturar
In HTML box: model.estado:array(0 => "Pendiente", 1 => "Completado")
Regards,
Pablo.
I don’t need change any value, only I want that “facturado” button is blocked or disappear in case that column “estado” <> “Completado”.
In binary box: model.facturar
In HTML box: model.estado:array(0 => "Pendiente", 1 => "Completado")
Regards,
Pablo.
So, did you get it working ? you can do it using the "HTML box"
No, I don’t see any change
Model.facturado:return ($row["Model"]["estado"] == "completado") ? 1 : 0);
The value in table of “estado” (Completado) = 1, then I write:
Model.facturado:return ($row["Model"]["estado"] == 1) ? 1 : 0);
But I see no change.. It’s possible that this line in HTML box is in conflict?
model.estado:array(0 => "Pendiente", 1 => "Completado")
Thanks,
Pablo.
Model.facturado:return ($row["Model"]["estado"] == "completado") ? 1 : 0);
The value in table of “estado” (Completado) = 1, then I write:
Model.facturado:return ($row["Model"]["estado"] == 1) ? 1 : 0);
But I see no change.. It’s possible that this line in HTML box is in conflict?
model.estado:array(0 => "Pendiente", 1 => "Completado")
Thanks,
Pablo.
All that this line:
Does is that it sets the "facturado" value to either 1 OR 0, then you can use it in any box, this doesn't change the "estado" value!
Model.facturado:return ($row["Model"]["estado"] == "completado") ? 1 : 0);
Does is that it sets the "facturado" value to either 1 OR 0, then you can use it in any box, this doesn't change the "estado" value!
This topic is locked and no more replies can be posted.