Page 1 of 1
Search Screen with different Edit Screens
Posted: Mon Jun 11, 2012 2:09 pm
by ruiascensao
Hi,
I have a database of IT assets. The asset can have different status (In use/in maintenance/waiting parts/faulty).
For this status I have forms (in use/maintenance/wparts/faulty). These forms use the same table but the edit screen just shows the necessary field for that status.
I world like to do different according to the status:
searchedit.jpg
Is this possible?
Best Regards,
Rui
Re: Search Screen with different Edit Screens
Posted: Tue Jun 12, 2012 1:58 am
by shane
one way to achieve what you need is to have the same form, but simply have display conditions on each object.
Assuming that the Asset Status is called asset_status in the database, the display condition needs an SQL result of either 0 or 1.
Code: Select all
SELECT IF('#asset_status#' < 1,'1','0')
or
Code: Select all
SELECT IF('#asset_status#' <> 1,'1','0')
Re: Search Screen with different Edit Screens
Posted: Tue Jun 12, 2012 10:29 am
by ruiascensao
Hi Shane,
I'm using:
Code: Select all
SELECT IF('#unit_status_id#' = 14fb0e1f28ca54,'1','0')
But I have the error:
"SQL
SELECT IF('14f84453ade474' = 14fb0e1f28ca54,'1','0')
Transaction
No Transaction.
Error
1054: Unknown column '14fb0e1f28ca54' in 'field list'"
Any idea?
Thank You!
Rui
Re: Search Screen with different Edit Screens
Posted: Tue Jun 12, 2012 5:12 pm
by massiws
ruiascensao ,
if you want to check the id (#unit_status_id#), maybe a solution could be:
Code: Select all
SELECT IF('#unit_status_id#' = '14fb0e1f28ca54','1','0')
Hope this helps.
Re: Search Screen with different Edit Screens
Posted: Wed Jun 13, 2012 5:31 am
by admin
rui,
massiws is right, you simply forgot to put the ID in quotes (making it a string).
Steven
Re: Search Screen with different Edit Screens
Posted: Wed Jun 13, 2012 12:37 pm
by ruiascensao
Hi,
Thank you!
It's working.
Regards,
Rui
Re: Search Screen with different Edit Screens
Posted: Thu Jun 14, 2012 1:33 am
by admin
.