This is an old revision of the document!


If you open a table in LISA you will get a graphical representation, similar to how it will look in Lime CRM. Once the table is opened, click anywhere in the header on the table and you can choose properties for the table to the right. Besides the properties you specified when you created the table, you can also choose for example where in LIME the table should appear (“Table Order”) and which actionpad should be the default (the html-area to the left when you open an object for this table in LIME).

You can also add a descriptive expression, which is used to specify which information should be printed out when using an object of this table. An empty descriptive expression will return the id number of the object. See example below

As described, Descriptive Expressions are SQL code. When typing them, the format is that you write the following

SELECT --This is predefined and not visible

[company].[name]–this is what you modify

FROM [tablename] WHERE [idTABLENAME]= THE_ID_OF_THE_CURRENT CARD –This is predefined and not visible

If you need to do a subquery, you should have it within (). An example could be when getting something from the string table, to get the text from an option field. See the example below as well.

SELECT --This is predefined and not visible

(SELECT [da] FROM [string] WHERE [idstirng] = [company].[buyingstatus] -- this is what you modify

FROM [tablename] WHERE [idTABLENAME] = THE_ID_OF_THE_CURRENT_CARD -- This is predefined and not visible

In the above example we get the Danish text from the option field Buying Status.

If you need to combine multiple things, you can do it by using the + sign. Just remember that you need to add whitespaces manually.

[company].[name] + ' - ' + [company].[city]

The above example simply adds the Company name, then a whitespace a - another whitespace and then the city.

Descriptive examples

Here you can find code to descriptive expressions that we use often. This code can be a start point that you can modify when creating your own descriptive expressions.

Company name as descriptive on an other card

Set company name as descriptive expression on a Role table (not on the company card, if you have an other table just change role to your table name):

(Select[name]from[company]where[company].[idcompany]=[role].[company])

An option from a option list as descriptive

If you want to have a option from a option list as a dresciptive expression use the following code. This eg. gets the TypeOfRole from a Role table to be used as a descriptive expression. If you want to get an other language change sv to correct language.

(Select[sv]from[string]where[string].[idstring]=[role].[typeofrole])

Two fields as descriptive expression

If you also want to have the company name and role as a descriptive expression, eg. "Lundalogik - Supplier" (Supplier is a 'typeofrole') use the following code:

(Select[name]from[company]where[comany].[idcompany]=[role].[company])+' - '+(Select[sv]from[string]where[string].[idstring]=[role].[typeofrole])

Don't forget the brackets!

Name Description
Invisible Select if a table should be invisible for everyone, just for administrators or for no one.
Table label Used by the web client. Changes to standard tables can break the web client.
Default Actionpad This should not be changed unless you're aware of the consequences.
Descriptive Expression The code in this field, defines the title of the table as shown in the top left part of the card and through relations. If no Descriptive Expression is written, the ID of the card will be shown through relations and as the title on the card.
Display name Here you can change the language dependent display name that is visible in Lime CRM
Log all changes Enables the changelog for the table. This can affect performance, and it's suggested only to be turned on for debugging.
Name The database name of the table. Changing this can break Lime CRM and therefore it should never be changed.
Private comment The possibility to add a comment that is only visibly through LISA.
Security policy Which security policy is enabled for this table. Security Policies are used to restrict access to tables and fields. You can read more about Security Policies in the chapter _Security -Policies_.
Table order The tables order in the overview.
Record acces properties Advanced object security. Do not add/change anything here unless you are 100% sure you know what you are doing.
Displayname Here you can change the singular name of the table.

Be aware that Record Access has been replaced with Object Access

With the record access functionality it is possible to filter records the users have access to in a specific table. For example a salesman in Denmark will only have access to Danish companies while a salesman in Sweden will only have access to Swedish companies.

There are two different ways of setting record access. The first one involves building a query and the second one writing an SQL function. Building a query is the easiest way of setting record access, but when you need additional functionality or when you want to optimize performance a writing an SQL function is usually a better choice. To activate record access on a table the property Record Access must be set to Function or LIME Access Query. If it is set to None record access will be deactivated even if a query is built and/or a function is created.

Example

The expression for Query for read access is similar to the WHERE-clause in an SQL statement.

Suppose we have a table called [company] with a relation to a table called [office]. In table [office] we have a field called [region] that specifies the location of the office. There is also a table calles [coworker] with a relation to [office]. If a user only is supposed to have access to companies in the same region as the user itself, the record access expression will look like this:

company.office.region = activeuser.office.region

The expression activeuser is a keyword that will be replaced with the active user's coworker record.

Be aware that complicated queries will affect performance. The query will be executed every time a user tries to access data in the table.

  • Last modified: 5 years ago
  • by Simon Jehrbo