Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Search Screen with different Edit Screens

Locked
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Search Screen with different Edit Screens

Unread post 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
searchedit.jpg (46.76 KiB) Viewed 4428 times
Is this possible?

Best Regards,
Rui
BR
Rui
shane
Posts: 100
Joined: Mon Jun 15, 2009 10:04 am

Re: Search Screen with different Edit Screens

Unread post 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')
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Re: Search Screen with different Edit Screens

Unread post 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
BR
Rui
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Search Screen with different Edit Screens

Unread post 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.
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Search Screen with different Edit Screens

Unread post by admin »

rui,

massiws is right, you simply forgot to put the ID in quotes (making it a string).

Steven
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Re: Search Screen with different Edit Screens

Unread post by ruiascensao »

Hi,

Thank you!
It's working.

Regards,
Rui
BR
Rui
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Search Screen with different Edit Screens

Unread post by admin »

.
Locked