---
title: "Lusid.CustomEntity.Definition"
slug: "lusidcustomentitydefinition"
updated: 2024-08-21T10:44:01Z
published: 2024-08-21T10:44:01Z
canonical: "support.lusid.com/lusidcustomentitydefinition"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.lusid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Lusid.CustomEntity.Definition

| **Type** | **Read/write** | **Author** | **Availability** |
| --- | --- | --- | --- |
| [Data provider](/v1/docs/what-are-a-data-provider-and-a-direct-provider) | Read | Finbourne | Provided with LUSID |

The `Lusid.CustomEntity.Definition` provider enables you to write a [Luminesce SQL query](/v1/docs/understanding-the-luminesce-sql-query-syntax) that retrieves [custom entity types](/v1/docs/how-do-i-use-luminesce-to-readwrite-custom-entities#defining-an-office-custom-entity-type) stored in LUSID, one row per user-specified data field for each custom entity type retrieved.

> **Note:** The LUSID user running the query must have sufficient [access control permissions](/v1/docs/creating-policies-to-control-access-to-providers-for-different-luminesce-end-users) to both use the provider *and* read custom entity type data in LUSID. This should automatically be the case if you are the domain owner.

You can use this provider to help create dedicated read and write Luminesce providers for your custom entities. [Find out more about this](/v1/docs/how-do-i-use-luminesce-to-readwrite-custom-entities).

**See also:** [Lusid.CustomEntity.Definition.Writer](/v1/docs/lusidcustomentitydefinitionwriter)

## Basic usage

```sql
select * from Lusid.CustomEntity.Definition where <filter-expression>;
```

## Query parameters

`Lusid.CustomEntity.Definition` has parameters that enable you to filter or refine a query.

To list available parameters, their data types, default values, and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

```sql
select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Lusid.CustomEntity.Definition' and FieldType = 'Parameter';
```

## Data fields

By default, `Lusid.CustomEntity.Definition` returns a table of data populated with particular fields (columns). You can return just a subset of these fields if you wish.

To list fields available to return, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

```sql
select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Lusid.CustomEntity.Definition' and FieldType = 'Column';
```

> **Note:** Fields marked 'main' are returned by queries that start select ^ from Lusid.CustomEntity.Definition...

## Examples

> **Note:** For more example Luminesce SQL queries, visit our [Github repo](https://github.com/finbourne/luminesce-examples/tree/master/examples).

### Example 1: Retrieve all the data fields for a particular custom entity type

Note a custom entity type must be prefixed by `~` to distinguish it from current or future [built-in entity types](/v1/docs/what-is-an-entity).

```sql
select * from Lusid.CustomEntity.Definition where EntityType is '~Office';
```

### Example 2: Retrieve data fields with particular data types for a particular custom entity type

```sql
select * from Lusid.CustomEntity.Definition where EntityTypeName is 'Office' and FieldType in ('string', 'decimal');
```
