Tree View
Tree
List View
Alphabetical List
Share
Share
Search:
id:
264

name:

Hide Inactive Fields from Drop-Downs



description:
Scenario: Bob is creating a new timesheet, and he's selecting a client from a drop-down. If some of your clients are no longer active, you do not want him to see them in this drop-down.

In this case, the first thing you will have to do is make sure your system has a way of knowing the client is no longer active. If you do not already have a field that tells you whether a client is active, you must Add an Active/Inactive Field.

Then you will have to set the clients table to only show active clients when users are entering clients records from a drop-down field in another table.

Get the Table ID of the Clients Table


Find the id of your Table and write it down, copy it to your clipboard, or remember it. You will need to get the right table id number for this to work!


You can find the TableID from Table Management

Write a SQL query


To hide an inactive record, you will need to use SQL security. Go to your Clients Table. Go to Table Management or Manage Tables. Click the link that says "Configure Table Settings" or "Settings".

Scroll down the Table Settings page to the field called "sqlsecurity". In that textbox, write the following statement, including all punctuation*:

('[_TABLEID]'=1048 or Active = 'Y')

Important: Change the id to match the id of your table!



Now, when Bob is creating a timesheet, he only sees active clients!



Important: Complete Data Entry is Key!


If you don't mark each client record as either active or inactive (and the field is empty) the record will be treated the same as if it were inactive. Be sure to mark all clients that you want in the list active!

* You could also write Active <> 'N'. The <> in a sql statement means 'not equal to'.


ParentTopic: