Choose a Restriction Field

In this dropdown box to the right of the Value field, there is shorthand notation for five restriction fields. The values that can be selected are:

These values represent the restrictions of the current user (to be filled in when the query is executed). For example, suppose you want to restrict queries on the site table so that a user can only see the sites that match their restrictions. And suppose that you add five fields to table_site named x_res1, x_res2…, x_res5. In this situation you would likely have the following five restriction clauses:

These clauses mean that any query on the site table will have additional clauses added by Dovetail SDK to make sure that the x_res1 field (for example) is equal to the current user's restriction.

To continue the example, suppose a user belongs to a restriction group where level 1 = 'AOL' and levels 2 through 5 are blank, and he writes the following code:

Dim site_rec as fcGeneric 

Set site_rec = fc_session.CreateGeneric 
site_rec.DBObjectName = "site" 
site_rec.AppendFilter "name", "like", "n" 
site_rec.Query

The code that Dovetail SDK will generate will look like this:

select * from table_site where name like 'n%' and x_res1 = 'AOL'

The programmer doesn't know about the restrictions and doesn't care. Another user, with no restrictions, would have only the first clause (name like 'n%') in their query. The clauses for levels 2-5 are ignored in this case, because the user has no levels 2-5 restrictions.

See Also

Clauses

View a Restriction Clause

Add a Restriction Clause

Update a Restriction Clause

Delete a Restriction Clause

Restriction Clauses Screenshot

Next

Restriction Clauses Screenshot

Choose a Restriction Field