diff --git a/src/.vuepress/config.js b/src/.vuepress/config.js index d74886fa..04068886 100644 --- a/src/.vuepress/config.js +++ b/src/.vuepress/config.js @@ -409,33 +409,7 @@ module.exports = config({ collapsable: true, children: [ ['/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/general.md', 'General'], - { - title: 'API', - collapsable: true, - children: [ - ['/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/globals.md', 'General'], - { - title: 'interfaces', - collapsable: true, - children: [ - ['/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDatasetEventListeners.md', 'IDatasetEventListeners'], - ['/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDataProviderEventListeners.md', 'IDataProviderEventListeners'], - ['/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDataProviderOptions.md', 'IDataProviderOptions'], - ] - }, - { - title: 'classes', - collapsable: true, - children: [ - ['/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/FetchXmlDataProvider.md', 'FetchXmlDataProvider'], - ['/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/MemoryDataProvider.md', 'MemoryDataProvider'], - ['/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/Record.md', 'Record'], - ['/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/Dataset.md', 'Dataset'], - ['/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/DataProvider.md', 'DataProvider'], - ] - } - ] - } + ['/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/globals.md', 'API'], ] } ] diff --git a/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/counter.gif b/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/counter.gif new file mode 100644 index 00000000..a52f9314 Binary files /dev/null and b/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/counter.gif differ diff --git a/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/disabled.gif b/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/disabled.gif new file mode 100644 index 00000000..a9a60b81 Binary files /dev/null and b/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/disabled.gif differ diff --git a/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/dynamic_height.gif b/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/dynamic_height.gif new file mode 100644 index 00000000..05d7b577 Binary files /dev/null and b/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/dynamic_height.gif differ diff --git a/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/loading.gif b/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/loading.gif new file mode 100644 index 00000000..ff799daa Binary files /dev/null and b/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/loading.gif differ diff --git a/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/ribbon.gif b/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/ribbon.gif new file mode 100644 index 00000000..3ee1c7ec Binary files /dev/null and b/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/ribbon.gif differ diff --git a/src/.vuepress/public/.attachments/applications/Controls/virtualdataset.png b/src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/virtualdataset.png similarity index 100% rename from src/.vuepress/public/.attachments/applications/Controls/virtualdataset.png rename to src/.vuepress/public/.attachments/applications/Controls/VirtualDataset/virtualdataset.png diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/DataProvider.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/DataProvider.md deleted file mode 100644 index 37b69f34..00000000 --- a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/DataProvider.md +++ /dev/null @@ -1,63 +0,0 @@ -Base class for all Data Providers. - -## Extended by - -- [`FetchXmlDataProvider`](FetchXmlDataProvider.md) -- [`MemoryDataProvider`](MemoryDataProvider.md) - -## Implements - -- [`IDataProvider`](../interfaces/IDataProvider.md) - -## Constructors - -### new DataProvider() - -> **new DataProvider**(`dataSource`, `columns`, `options`?): [`DataProvider`](DataProvider.md) - -Creates an instance of DataProvider. - -#### Parameters - -• **dataSource**: `any` - -• **columns**: `Column` & `object`[] - -• **options?**: [`IDataProviderOptions`](../interfaces/IDataProviderOptions.md) - -#### Returns - -[`DataProvider`](DataProvider.md) - -#### Defined in - -src/utils/dataset/data-providers/DataProvider.ts:41 - - -### addEventListener() - -> **addEventListener**\<`K`\>(`event`, `eventListener`): `void` - -Allows to define listener method that will trigger when specific event occurs. - -#### Type Parameters - -• **K** *extends* keyof [`IDataProviderEventListeners`](../interfaces/IDataProviderEventListeners.md) - -#### Parameters - -• **event**: `K` - -• **eventListener**: [`IDataProviderEventListeners`](../interfaces/IDataProviderEventListeners.md)\[`K`\] - -#### Returns - -`void` - -#### Implementation of - -[`IDataProvider`](../interfaces/IDataProvider.md).[`addEventListener`](../interfaces/IDataProvider.md#addeventlistener) - -#### Defined in - -src/utils/dataset/data-providers/DataProvider.ts:139 \ No newline at end of file diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/Dataset.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/Dataset.md deleted file mode 100644 index e999cb8b..00000000 --- a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/Dataset.md +++ /dev/null @@ -1,544 +0,0 @@ -Uses Data Provider and is passed as dataset parameter to PCF's - -## Implements - -- [`IDataset`](../interfaces/IDataset.md) - -## Constructors - -### new Dataset() - -> **new Dataset**(`dataProvider`): [`Dataset`](Dataset.md) - -Creates an instance of Dataset. - -#### Parameters - -• **dataProvider**: `DataProvider` - -#### Returns - -[`Dataset`](Dataset.md) - -#### Defined in - -src/utils/dataset/Dataset.ts:28 - -## Accessors - -### columns - -> `get` **columns**(): `Column` & `object`[] - -Metadata about a column in a dataset. If the column name ends with `__virtual`, it tells the provider it should not try to fetch column metadata from its Data Source. -In this case, you need to specify all the necessary metadata yourself. - -#### Returns - -`Column` & `object`[] - -Metadata about a column in a dataset. If the column name ends with `__virtual`, it tells the provider it should not try to fetch column metadata from its Data Source. -In this case, you need to specify all the necessary metadata yourself. - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`columns`](../interfaces/IDataset.md#columns) - -#### Defined in - -src/utils/dataset/Dataset.ts:31 - -*** - -### error - -> `get` **error**(): `boolean` - -True if encountered error while data retrieval - -#### Returns - -`boolean` - -True if encountered error while data retrieval - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`error`](../interfaces/IDataset.md#error) - -#### Defined in - -src/utils/dataset/Dataset.ts:43 - -*** - -### errorMessage - -> `get` **errorMessage**(): `string` - -The error message associated with the last encountered error, if applicable - -#### Returns - -`string` - -The error message associated with the last encountered error, if applicable - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`errorMessage`](../interfaces/IDataset.md#errormessage) - -#### Defined in - -src/utils/dataset/Dataset.ts:46 - -*** - -### filtering - -> `get` **filtering**(): `Omit`\<`Filtering`, `"getFilter"`\> & `object` - -Filter state for a dataset. - -#### Returns - -`Omit`\<`Filtering`, `"getFilter"`\> & `object` - -Filter state for a dataset. - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`filtering`](../interfaces/IDataset.md#filtering) - -#### Defined in - -src/utils/dataset/Dataset.ts:88 - -*** - -### linking - -> `get` **linking**(): `Linking` - -Related entity info - -#### Returns - -`Linking` - -Related entity info - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`linking`](../interfaces/IDataset.md#linking) - -#### Defined in - -src/utils/dataset/Dataset.ts:58 - -*** - -### loading - -> `get` **loading**(): `boolean` - -Indicate if the dataset property is in loading state or not - -#### Returns - -`boolean` - -Indicate if the dataset property is in loading state or not - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`loading`](../interfaces/IDataset.md#loading) - -#### Defined in - -src/utils/dataset/Dataset.ts:49 - -*** - -### records - -> `get` **records**(): `object` - -Map of IDs to the full record object. - -#### Returns - -`object` - -Map of IDs to the full record object. - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`records`](../interfaces/IDataset.md#records) - -#### Defined in - -src/utils/dataset/Dataset.ts:102 - -*** - -### sortedRecordIds - -> `get` **sortedRecordIds**(): `string`[] - -IDs of the records in the dataset, order by the query response result - -#### Returns - -`string`[] - -IDs of the records in the dataset, order by the query response result - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`sortedRecordIds`](../interfaces/IDataset.md#sortedrecordids) - -#### Defined in - -src/utils/dataset/Dataset.ts:123 - -*** - -### sorting - -> `get` **sorting**(): `SortStatus`[] - -The sorting status for the current query. - -> `set` **sorting**(`sort`): `void` - -The sorting status for the current query. - -#### Parameters - -• **sort**: `SortStatus`[] - -#### Returns - -`SortStatus`[] - -The sorting status for the current query. - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`sorting`](../interfaces/IDataset.md#sorting) - -#### Defined in - -src/utils/dataset/Dataset.ts:52 - -## Methods - -### addEventListener() - -> **addEventListener**\<`K`\>(`event`, `eventListener`): `void` - -Allows to define listener method that will trigger when specific event occurs. - -#### Type Parameters - -• **K** *extends* keyof [`IDatasetEventListeners`](../interfaces/IDatasetEventListeners.md) - -#### Parameters - -• **event**: `K` - -• **eventListener**: [`IDatasetEventListeners`](../interfaces/IDatasetEventListeners.md)\[`K`\] - -#### Returns - -`void` - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`addEventListener`](../interfaces/IDataset.md#addeventlistener) - -#### Defined in - -src/utils/dataset/Dataset.ts:197 - -*** - -### clearSelectedRecordIds() - -> **clearSelectedRecordIds**(): `void` - -Clear selected record ids list - -#### Returns - -`void` - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`clearSelectedRecordIds`](../interfaces/IDataset.md#clearselectedrecordids) - -#### Defined in - -src/utils/dataset/Dataset.ts:130 - -*** - -### getDataProvider() - -> **getDataProvider**(): `DataProvider` - -Returns a data provider instance. - -#### Returns - -`DataProvider` - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`getDataProvider`](../interfaces/IDataset.md#getdataprovider) - -#### Defined in - -src/utils/dataset/Dataset.ts:173 - -*** - -### getDataSource() - -> **getDataSource**(): `any` - -Gets the Data Source. - -#### Returns - -`any` - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`getDataSource`](../interfaces/IDataset.md#getdatasource) - -#### Defined in - -src/utils/dataset/Dataset.ts:40 - -*** - -### getMetadata() - -> **getMetadata**(): `null` \| `EntityMetadata` - -Gets the associated entity metadata. - -#### Returns - -`null` \| `EntityMetadata` - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`getMetadata`](../interfaces/IDataset.md#getmetadata) - -#### Defined in - -src/utils/dataset/Dataset.ts:158 - -*** - -### getSelectedRecordIds() - -> **getSelectedRecordIds**(): `string`[] - -Retrieves all selected record ids - -#### Returns - -`string`[] - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`getSelectedRecordIds`](../interfaces/IDataset.md#getselectedrecordids) - -#### Defined in - -src/utils/dataset/Dataset.ts:133 - -*** - -### getTargetEntityType() - -> **getTargetEntityType**(): `string` - -Get DataSet target entity logical name - -#### Returns - -`string` - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`getTargetEntityType`](../interfaces/IDataset.md#gettargetentitytype) - -#### Defined in - -src/utils/dataset/Dataset.ts:142 - -*** - -### getTitle() - -> **getTitle**(): `string` - -Retrieves the view display name used by the dataset property - -#### Returns - -`string` - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`getTitle`](../interfaces/IDataset.md#gettitle) - -#### Defined in - -src/utils/dataset/Dataset.ts:145 - -*** - -### getViewId() - -> **getViewId**(): `string` - -Gets Id of view used by the dataset property - -#### Returns - -`string` - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`getViewId`](../interfaces/IDataset.md#getviewid) - -#### Defined in - -src/utils/dataset/Dataset.ts:148 - -*** - -### openDatasetItem() - -> **openDatasetItem**(`entityReference`): `void` - -Open dataSet item for a given EntityReference. It will check if there is a command with command button id "Mscrm.OpenRecordItem". -If there is, it will execute the command, otherwise it will just navigate to the associated form of the entityReference - -#### Parameters - -• **entityReference**: `EntityReference` - -entity reference - -#### Returns - -`void` - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`openDatasetItem`](../interfaces/IDataset.md#opendatasetitem) - -#### Defined in - -src/utils/dataset/Dataset.ts:151 - -*** - -### refresh() - -> **refresh**(): `Promise`\<`void`\> - -Refreshes the dataset based on filters, sorting, linking, new column. New data will be pushed to control in another 'updateView' cycle. - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`refresh`](../interfaces/IDataset.md#refresh) - -#### Defined in - -src/utils/dataset/Dataset.ts:154 - -*** - -### setDataSource() - -> **setDataSource**(`dataSource`): `void` - -Allows you to change the initial Data Source. - -#### Parameters - -• **dataSource**: `any` - -#### Returns - -`void` - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`setDataSource`](../interfaces/IDataset.md#setdatasource) - -#### Defined in - -src/utils/dataset/Dataset.ts:37 - -*** - -### setMetadata() - -> **setMetadata**(`metadata`): `void` - -Allows you to change the initial associated entity metadata. - -#### Parameters - -• **metadata**: `EntityMetadata` - -#### Returns - -`void` - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`setMetadata`](../interfaces/IDataset.md#setmetadata) - -#### Defined in - -src/utils/dataset/Dataset.ts:161 - -*** - -### setSelectedRecordIds() - -> **setSelectedRecordIds**(`ids`): `void` - -Set the ids of the selected records - -#### Parameters - -• **ids**: `string`[] - -List of recordId's - -#### Returns - -`void` - -#### Implementation of - -[`IDataset`](../interfaces/IDataset.md).[`setSelectedRecordIds`](../interfaces/IDataset.md#setselectedrecordids) - -#### Defined in - -src/utils/dataset/Dataset.ts:138 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/FetchXmlDataProvider.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/FetchXmlDataProvider.md index 6a908791..ccc4fb76 100644 --- a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/FetchXmlDataProvider.md +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/FetchXmlDataProvider.md @@ -4,6 +4,10 @@ Allows you to use fetchXml as a Data Source. - `DataProvider` +## Implements + +- [`IDataProvider`](../interfaces/IDataProvider.md) + ## Constructors ### new FetchXmlDataProvider() @@ -16,9 +20,9 @@ Creates an instance of FetchXmlDataProvider. • **fetchXml**: `string` -• **columns?**: `Column` & `object`[] +• **columns?**: [`IColumn`](../interfaces/IColumn.md)[] -• **options?**: [`IDataProviderOptions`](../interfaces/IDataProviderOptions.md) +• **options?**: [`IFetchXmlDataProviderOptions`](../interfaces/IFetchXmlDataProviderOptions.md) #### Returns @@ -30,4 +34,480 @@ Creates an instance of FetchXmlDataProvider. #### Defined in -src/utils/dataset/data-providers/FetchXmlDataProvider.ts:21 \ No newline at end of file +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:47 + +## Methods + +### getColumns() + +> **getColumns**(): [`IColumn`](../interfaces/IColumn.md)[] + +Returns column information, such as column names and data types. + +#### Returns + +[`IColumn`](../interfaces/IColumn.md)[] + +An array of column information objects. + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getColumns`](../interfaces/IDataProvider.md#getcolumns) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:89 + +*** + +### getDataSource() + +> **getDataSource**(): `string` + +Gets the current Data Source. + +#### Returns + +`string` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getDataSource`](../interfaces/IDataProvider.md#getdatasource) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:104 + +*** + +### getEntityName() + +> **getEntityName**(): `string` + +Returns the name of the associated entity. + +#### Returns + +`string` + +The entity name. + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getEntityName`](../interfaces/IDataProvider.md#getentityname) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:86 + +*** + +### getErrorMessage() + +> **getErrorMessage**(): `string` + +Returns the error message from the last data retrieval attempt, if any. + +#### Returns + +`string` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getErrorMessage`](../interfaces/IDataProvider.md#geterrormessage) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:77 + +*** + +### getMetadata() + +> **getMetadata**(): `EntityMetadata` + +Gets the associated entity metadata. + +#### Returns + +`EntityMetadata` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getMetadata`](../interfaces/IDataProvider.md#getmetadata) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:80 + +*** + +### getPaging() + +> **getPaging**(): `object` + +Returns paging information (like page number, total pages, etc.). + +#### Returns + +`object` + +The paging information. + +##### firstPageNumber + +> **firstPageNumber**: `number` + +##### hasNextPage + +> **hasNextPage**: `boolean` + +##### hasPreviousPage + +> **hasPreviousPage**: `boolean` + +##### lastPageNumber + +> **lastPageNumber**: `number` + +##### loadExactPage() + +> **loadExactPage**: (`pageNumber`) => `Promise`\<[`IRecord`](../interfaces/IRecord.md)[]\> + +###### Parameters + +• **pageNumber**: `number` + +###### Returns + +`Promise`\<[`IRecord`](../interfaces/IRecord.md)[]\> + +##### loadNextPage() + +> **loadNextPage**: () => `Promise`\<[`IRecord`](../interfaces/IRecord.md)[]\> + +###### Returns + +`Promise`\<[`IRecord`](../interfaces/IRecord.md)[]\> + +##### loadPreviousPage() + +> **loadPreviousPage**: () => `Promise`\<[`IRecord`](../interfaces/IRecord.md)[]\> + +###### Returns + +`Promise`\<[`IRecord`](../interfaces/IRecord.md)[]\> + +##### pageNumber + +> **pageNumber**: `number` + +##### pageSize + +> **pageSize**: `number` + +##### reset() + +> **reset**: () => `Promise`\<[`IRecord`](../interfaces/IRecord.md)[]\> + +###### Returns + +`Promise`\<[`IRecord`](../interfaces/IRecord.md)[]\> + +##### setPageSize() + +> **setPageSize**: (`pageSize`) => `void` + +###### Parameters + +• **pageSize**: `number` + +###### Returns + +`void` + +##### totalResultCount + +> **totalResultCount**: `number` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getPaging`](../interfaces/IDataProvider.md#getpaging) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:122 + +*** + +### getRawRecordData() + +> **getRawRecordData**(`recordId`): `null` \| `object` + +Retrieves the raw record data for a given record by its ID. + +#### Parameters + +• **recordId**: `string` + +#### Returns + +`null` \| `object` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getRawRecordData`](../interfaces/IDataProvider.md#getrawrecorddata) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:166 + +*** + +### getRecords() + +> **getRecords**(): [`IRecord`](../interfaces/IRecord.md)[] + +Returns the list of records. + +#### Returns + +[`IRecord`](../interfaces/IRecord.md)[] + +A list of records. + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getRecords`](../interfaces/IDataProvider.md#getrecords) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:116 + +*** + +### getTitle() + +> **getTitle**(): `string` + +Returns the title provided by the data provider. + +#### Returns + +`string` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getTitle`](../interfaces/IDataProvider.md#gettitle) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:70 + +*** + +### getViewId() + +> **getViewId**(): `string` + +Returns the ID of the current view. + +#### Returns + +`string` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getViewId`](../interfaces/IDataProvider.md#getviewid) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:162 + +*** + +### isError() + +> **isError**(): `boolean` + +Returns true if an error occurred during the last data retrieval process. + +#### Returns + +`boolean` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`isError`](../interfaces/IDataProvider.md#iserror) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:66 + +*** + +### openDatasetItem() + +> **openDatasetItem**(`entityReference`): `void` + +Can be used to specify what default action happens for record opening on a specific provider. + +#### Parameters + +• **entityReference**: `EntityReference` + +#### Returns + +`void` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`openDatasetItem`](../interfaces/IDataProvider.md#opendatasetitem) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:170 + +*** + +### refresh() + +> **refresh**(): `Promise`\<[`IRecord`](../interfaces/IRecord.md)[]\> + +Refreshes the records list and returns the refreshed records. + +#### Returns + +`Promise`\<[`IRecord`](../interfaces/IRecord.md)[]\> + +A promise resolving to a list of refreshed records. + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`refresh`](../interfaces/IDataProvider.md#refresh) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:108 + +*** + +### save() + +> **save**(`record`): `Promise`\<`void`\> + +Saves the provided record to the database. + +#### Parameters + +• **record**: [`IRecord`](../interfaces/IRecord.md) + +#### Returns + +`Promise`\<`void`\> + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`save`](../interfaces/IDataProvider.md#save) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:158 + +*** + +### setColumns() + +> **setColumns**(`columns`): `void` + +Sets the columns for the dataset. + +#### Parameters + +• **columns**: [`IColumn`](../interfaces/IColumn.md)[] + +#### Returns + +`void` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`setColumns`](../interfaces/IDataProvider.md#setcolumns) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:97 + +*** + +### setDataSource() + +> **setDataSource**(`dataSource`): `void` + +Allows you to change the initial Data Source. + +#### Parameters + +• **dataSource**: `any` + +The new data source. + +#### Returns + +`void` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`setDataSource`](../interfaces/IDataProvider.md#setdatasource) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:101 + +*** + +### setMetadata() + +> **setMetadata**(`metadata`): `void` + +Allows you to change the initial associated entity metadata. + +#### Parameters + +• **metadata**: `EntityMetadata` + +#### Returns + +`void` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`setMetadata`](../interfaces/IDataProvider.md#setmetadata) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:83 + +*** + +### setTitle() + +> **setTitle**(`title`): `void` + +Sets the dataset's title. + +#### Parameters + +• **title**: `string` + +#### Returns + +`void` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`setTitle`](../interfaces/IDataProvider.md#settitle) + +#### Defined in + +src/utils/dataset/data-providers/FetchXmlDataProvider/FetchXmlDataProvider.ts:74 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/MemoryDataProvider.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/MemoryDataProvider.md index 49467b74..7b22aa0b 100644 --- a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/MemoryDataProvider.md +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/MemoryDataProvider.md @@ -4,11 +4,15 @@ Allows you to use in-memory array as Data Source. - `DataProvider` +## Implements + +- [`IDataProvider`](../interfaces/IDataProvider.md) + ## Constructors ### new MemoryDataProvider() -> **new MemoryDataProvider**(`dataSource`, `columns`, `options`?): [`MemoryDataProvider`](MemoryDataProvider.md) +> **new MemoryDataProvider**(`dataSource`, `columns`, `options`): [`MemoryDataProvider`](MemoryDataProvider.md) Creates an instance of MemoryDataProvider. @@ -16,9 +20,9 @@ Creates an instance of MemoryDataProvider. • **dataSource**: `object`[] -• **columns**: `Column` & `object`[] +• **columns**: [`IColumn`](../interfaces/IColumn.md)[] -• **options?**: [`IDataProviderOptions`](../interfaces/IDataProviderOptions.md) +• **options**: [`IMemoryDataProviderOptions`](../interfaces/IMemoryDataProviderOptions.md) #### Returns @@ -30,4 +34,400 @@ Creates an instance of MemoryDataProvider. #### Defined in -src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:16 \ No newline at end of file +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:33 + +## Methods + +### getColumns() + +> **getColumns**(): [`IColumn`](../interfaces/IColumn.md)[] + +Returns column information, such as column names and data types. + +#### Returns + +[`IColumn`](../interfaces/IColumn.md)[] + +An array of column information objects. + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getColumns`](../interfaces/IDataProvider.md#getcolumns) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:44 + +*** + +### getDataSource() + +> **getDataSource**(): `object`[] + +Gets the current Data Source. + +#### Returns + +`object`[] + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getDataSource`](../interfaces/IDataProvider.md#getdatasource) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:99 + +*** + +### getEntityName() + +> **getEntityName**(): `string` + +Returns the name of the associated entity. + +#### Returns + +`string` + +The entity name. + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getEntityName`](../interfaces/IDataProvider.md#getentityname) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:135 + +*** + +### getErrorMessage() + +> **getErrorMessage**(): `string` + +Returns the error message from the last data retrieval attempt, if any. + +#### Returns + +`string` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getErrorMessage`](../interfaces/IDataProvider.md#geterrormessage) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:107 + +*** + +### getMetadata() + +> **getMetadata**(): `EntityMetadata` + +Gets the associated entity metadata. + +#### Returns + +`EntityMetadata` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getMetadata`](../interfaces/IDataProvider.md#getmetadata) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:127 + +*** + +### getPaging() + +> **getPaging**(): `Paging` & `object` + +Returns paging information (like page number, total pages, etc.). + +#### Returns + +`Paging` & `object` + +The paging information. + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getPaging`](../interfaces/IDataProvider.md#getpaging) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:48 + +*** + +### getRawRecordData() + +> **getRawRecordData**(`recordId`): `null` \| `object` + +Retrieves the raw record data for a given record by its ID. + +#### Parameters + +• **recordId**: `string` + +#### Returns + +`null` \| `object` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getRawRecordData`](../interfaces/IDataProvider.md#getrawrecorddata) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:92 + +*** + +### getRecords() + +> **getRecords**(): [`IRecord`](../interfaces/IRecord.md)[] + +Returns the list of records. + +#### Returns + +[`IRecord`](../interfaces/IRecord.md)[] + +A list of records. + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getRecords`](../interfaces/IDataProvider.md#getrecords) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:86 + +*** + +### getTitle() + +> **getTitle**(): `string` + +Returns the title provided by the data provider. + +#### Returns + +`string` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getTitle`](../interfaces/IDataProvider.md#gettitle) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:110 + +*** + +### getViewId() + +> **getViewId**(): `string` + +Returns the ID of the current view. + +#### Returns + +`string` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`getViewId`](../interfaces/IDataProvider.md#getviewid) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:139 + +*** + +### isError() + +> **isError**(): `boolean` + +Returns true if an error occurred during the last data retrieval process. + +#### Returns + +`boolean` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`isError`](../interfaces/IDataProvider.md#iserror) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:103 + +*** + +### openDatasetItem() + +> **openDatasetItem**(): `void` + +Can be used to specify what default action happens for record opening on a specific provider. + +#### Returns + +`void` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`openDatasetItem`](../interfaces/IDataProvider.md#opendatasetitem) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:122 + +*** + +### refresh() + +> **refresh**(): [`IRecord`](../interfaces/IRecord.md)[] + +Refreshes the records list and returns the refreshed records. + +#### Returns + +[`IRecord`](../interfaces/IRecord.md)[] + +A promise resolving to a list of refreshed records. + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`refresh`](../interfaces/IDataProvider.md#refresh) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:80 + +*** + +### save() + +> **save**(`record`): `Promise`\<`void`\> + +Saves the provided record to the database. + +#### Parameters + +• **record**: [`IRecord`](../interfaces/IRecord.md) + +#### Returns + +`Promise`\<`void`\> + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`save`](../interfaces/IDataProvider.md#save) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:118 + +*** + +### setColumns() + +> **setColumns**(`columns`): `void` + +Sets the columns for the dataset. + +#### Parameters + +• **columns**: [`IColumn`](../interfaces/IColumn.md)[] + +#### Returns + +`void` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`setColumns`](../interfaces/IDataProvider.md#setcolumns) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:40 + +*** + +### setDataSource() + +> **setDataSource**(`dataSource`): `void` + +Allows you to change the initial Data Source. + +#### Parameters + +• **dataSource**: `object`[] + +The new data source. + +#### Returns + +`void` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`setDataSource`](../interfaces/IDataProvider.md#setdatasource) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:96 + +*** + +### setMetadata() + +> **setMetadata**(`metadata`): `void` + +Allows you to change the initial associated entity metadata. + +#### Parameters + +• **metadata**: `EntityMetadata` + +#### Returns + +`void` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`setMetadata`](../interfaces/IDataProvider.md#setmetadata) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:131 + +*** + +### setTitle() + +> **setTitle**(`title`): `void` + +Sets the dataset's title. + +#### Parameters + +• **title**: `string` + +#### Returns + +`void` + +#### Implementation of + +[`IDataProvider`](../interfaces/IDataProvider.md).[`setTitle`](../interfaces/IDataProvider.md#settitle) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:114 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/Record.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/Record.md deleted file mode 100644 index eaf03cbc..00000000 --- a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/classes/Record.md +++ /dev/null @@ -1,159 +0,0 @@ -Instance of a record, - -## Implements - -- [`IRecord`](../interfaces/IRecord.md) - -## Constructors - -### new Record() - -> **new Record**(`recordId`, `dataProvider`): [`Record`](Record.md) - -Creates an instance of Record. - -#### Parameters - -• **recordId**: `string` - -• **dataProvider**: `DataProvider` - -#### Returns - -[`Record`](Record.md) - -#### Defined in - -src/utils/dataset/data-providers/Record.ts:24 - -## Methods - -### getFormattedValue() - -> **getFormattedValue**(`columnName`): `null` \| `string` - -Get the current formatted value of this record column. - -#### Parameters - -• **columnName**: `string` - -Column name of the record - -#### Returns - -`null` \| `string` - -#### Implementation of - -[`IRecord`](../interfaces/IRecord.md).[`getFormattedValue`](../interfaces/IRecord.md#getformattedvalue) - -#### Defined in - -src/utils/dataset/data-providers/Record.ts:34 - -*** - -### getNamedReference() - -> **getNamedReference**(): `EntityReference` - -Get the object that encapsulates an Entity Reference as a plain object - -#### Returns - -`EntityReference` - -#### Implementation of - -[`IRecord`](../interfaces/IRecord.md).[`getNamedReference`](../interfaces/IRecord.md#getnamedreference) - -#### Defined in - -src/utils/dataset/data-providers/Record.ts:199 - -*** - -### getRawData() - -> **getRawData**(): `object` - -Retrieves the raw record data. - -#### Returns - -`object` - -#### Implementation of - -[`IRecord`](../interfaces/IRecord.md).[`getRawData`](../interfaces/IRecord.md#getrawdata) - -#### Defined in - -src/utils/dataset/data-providers/Record.ts:213 - -*** - -### getRecordId() - -> **getRecordId**(): `string` - -Get the record ID - -#### Returns - -`string` - -#### Implementation of - -[`IRecord`](../interfaces/IRecord.md).[`getRecordId`](../interfaces/IRecord.md#getrecordid) - -#### Defined in - -src/utils/dataset/data-providers/Record.ts:107 - -*** - -### save() - -> **save**(): `Promise`\<`void`\> - -Saves the record. - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`IRecord`](../interfaces/IRecord.md).[`save`](../interfaces/IRecord.md#save) - -#### Defined in - -src/utils/dataset/data-providers/Record.ts:209 - -*** - -### setValue() - -> **setValue**(`columnName`, `value`): `void` - -Sets the value of a given column. - -#### Parameters - -• **columnName**: `string` - -• **value**: `any` - -#### Returns - -`void` - -#### Implementation of - -[`IRecord`](../interfaces/IRecord.md).[`setValue`](../interfaces/IRecord.md#setvalue) - -#### Defined in - -src/utils/dataset/data-providers/Record.ts:123 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/globals.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/globals.md index a99174f9..92bed626 100644 --- a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/globals.md +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/globals.md @@ -1,20 +1,31 @@ ---- -Author: Dominik Brych ---- -# API - ## Classes -- [Dataset](classes/Dataset.md) - [FetchXmlDataProvider](classes/FetchXmlDataProvider.md) - [MemoryDataProvider](classes/MemoryDataProvider.md) -- [Record](classes/Record.md) ## Interfaces +- [IAddControlNotificationOptions](interfaces/IAddControlNotificationOptions.md) +- [IColumn](interfaces/IColumn.md) +- [IColumnInfo](interfaces/IColumnInfo.md) +- [IControlNotificationAction](interfaces/IControlNotificationAction.md) +- [ICurrency](interfaces/ICurrency.md) - [IDataProvider](interfaces/IDataProvider.md) -- [IDataProviderEventListeners](interfaces/IDataProviderEventListeners.md) - [IDataProviderOptions](interfaces/IDataProviderOptions.md) - [IDataset](interfaces/IDataset.md) - [IDatasetEventListeners](interfaces/IDatasetEventListeners.md) +- [IFetchXmlDataProviderOptions](interfaces/IFetchXmlDataProviderOptions.md) +- [IFieldChange](interfaces/IFieldChange.md) +- [IFieldValidationResult](interfaces/IFieldValidationResult.md) +- [IMemoryDataProviderOptions](interfaces/IMemoryDataProviderOptions.md) - [IRecord](interfaces/IRecord.md) +- [IRecordChange](interfaces/IRecordChange.md) +- [IRecordChanges](interfaces/IRecordChanges.md) +- [IRecordExpressions](interfaces/IRecordExpressions.md) +- [IRecordUiExpression](interfaces/IRecordUiExpression.md) +- [ISecurityValues](interfaces/ISecurityValues.md) + +## Type Aliases + +- [DeepPartial](type-aliases/DeepPartial.md) +- [IAttributeMetadata](type-aliases/IAttributeMetadata.md) diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IAddControlNotificationOptions.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IAddControlNotificationOptions.md new file mode 100644 index 00000000..35ad82db --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IAddControlNotificationOptions.md @@ -0,0 +1,114 @@ +Options for setting record column notifications. + +## Extends + +- `Omit`\<`Xrm.Controls.AddControlNotificationOptions`, `"actions"`\> + +## Properties + +### actions? + +> `optional` **actions**: [`IControlNotificationAction`](IControlNotificationAction.md)[] + +A collection of actions + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:480 + +*** + +### compact? + +> `optional` **compact**: `boolean` + +Whether the notification should be rendered in compact form. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:470 + +*** + +### iconName? + +> `optional` **iconName**: `string` + +Fluent icon associated with the notification. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:460 + +*** + +### messages + +> **messages**: `string`[] + +The message to display in the notification. +In the current release, only the first message specified in this array will be displayed. + +#### Inherited from + +`Omit.messages` + +#### Defined in + +node\_modules/@types/xrm/index.d.ts:4377 + +*** + +### notificationLevel? + +> `optional` **notificationLevel**: `NotificationLevel` + +Defines the type of notification. + +#### Inherited from + +`Omit.notificationLevel` + +#### Defined in + +node\_modules/@types/xrm/index.d.ts:4382 + +*** + +### renderedInOverflow? + +> `optional` **renderedInOverflow**: `boolean` + +Whether the notification should always be rendered in overflow. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:475 + +*** + +### title? + +> `optional` **title**: `string` + +Title of the notification. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:465 + +*** + +### uniqueId + +> **uniqueId**: `string` + +The ID to use to clear this notification when using the clearNotification method. + +#### Inherited from + +`Omit.uniqueId` + +#### Defined in + +node\_modules/@types/xrm/index.d.ts:4387 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IColumn.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IColumn.md new file mode 100644 index 00000000..b61b697b --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IColumn.md @@ -0,0 +1,150 @@ +Metadata about a column in a dataset. If the column name ends with `__virtual`, it tells the provider it should not try to fetch column metadata from its Data Source. +In this case, you need to specify all the necessary metadata yourself. If a property is optional, it does not exists in Microsoft's dataset implementation. + +## Extends + +- `Column` + +## Properties + +### alias + +> **alias**: `string` + +The alias of this column. + +#### Inherited from + +`ComponentFramework.PropertyHelper.DataSetApi.Column.alias` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1834 + +*** + +### dataType + +> **dataType**: `string` + +The manifest type of this column's values. + +#### Inherited from + +`ComponentFramework.PropertyHelper.DataSetApi.Column.dataType` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1829 + +*** + +### disableSorting? + +> `optional` **disableSorting**: `boolean` + +Prevents the UI from making the column sortable. + +#### Inherited from + +`ComponentFramework.PropertyHelper.DataSetApi.Column.disableSorting` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1859 + +*** + +### displayName + +> **displayName**: `string` + +Localized display name for the column + +#### Inherited from + +`ComponentFramework.PropertyHelper.DataSetApi.Column.displayName` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1824 + +*** + +### isHidden? + +> `optional` **isHidden**: `boolean` + +The column visibility state. + +#### Inherited from + +`ComponentFramework.PropertyHelper.DataSetApi.Column.isHidden` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1849 + +*** + +### isPrimary? + +> `optional` **isPrimary**: `boolean` + +Is specific column the primary attrribute of the view's entity + +#### Inherited from + +`ComponentFramework.PropertyHelper.DataSetApi.Column.isPrimary` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1854 + +*** + +### name + +> **name**: `string` + +Name of the column, unique in this dataset + +#### Inherited from + +`ComponentFramework.PropertyHelper.DataSetApi.Column.name` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1819 + +*** + +### order + +> **order**: `number` + +The column order for the layout + +#### Inherited from + +`ComponentFramework.PropertyHelper.DataSetApi.Column.order` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1839 + +*** + +### visualSizeFactor + +> **visualSizeFactor**: `number` + +Customized column width ratios + +#### Inherited from + +`ComponentFramework.PropertyHelper.DataSetApi.Column.visualSizeFactor` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1844 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IColumnInfo.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IColumnInfo.md new file mode 100644 index 00000000..c10c7fd0 --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IColumnInfo.md @@ -0,0 +1,61 @@ +Includes information about record column. + +## Extends + +- [`IFieldValidationResult`](IFieldValidationResult.md) + +## Properties + +### error + +> **error**: `boolean` + +Returns true if the record column value has invalid value. + +#### Inherited from + +[`IFieldValidationResult`](IFieldValidationResult.md).[`error`](IFieldValidationResult.md#error) + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:445 + +*** + +### errorMessage + +> **errorMessage**: `string` + +Error message for invalid record column value. + +#### Inherited from + +[`IFieldValidationResult`](IFieldValidationResult.md).[`errorMessage`](IFieldValidationResult.md#errormessage) + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:449 + +*** + +### security + +> **security**: [`ISecurityValues`](ISecurityValues.md) + +Security values for record column. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:10 + +*** + +### type + +> **type**: `string` + +Type of the column. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:15 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IControlNotificationAction.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IControlNotificationAction.md new file mode 100644 index 00000000..1235b6fb --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IControlNotificationAction.md @@ -0,0 +1,49 @@ +Interface to define the actions on a control notification + +## Extends + +- `ControlNotificationAction` + +## Properties + +### actions + +> **actions**: () => `void`[] + +Array of functions. The corresponding actions for the message. + +#### Inherited from + +`Xrm.Controls.ControlNotificationAction.actions` + +#### Defined in + +node\_modules/@types/xrm/index.d.ts:4407 + +*** + +### iconName? + +> `optional` **iconName**: `string` + +Fluent icon associated with the action. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:491 + +*** + +### message? + +> `optional` **message**: `string` + +The body message of the notification to be displayed to the user. Limit your message to 100 characters for optimal user experience. + +#### Inherited from + +`Xrm.Controls.ControlNotificationAction.message` + +#### Defined in + +node\_modules/@types/xrm/index.d.ts:4402 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/ICurrency.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/ICurrency.md new file mode 100644 index 00000000..19525455 --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/ICurrency.md @@ -0,0 +1,37 @@ +Metadata for record currency. + +## Properties + +### currencyname + +> **currencyname**: `string` + +Name of the currency record. + +#### Defined in + +src/utils/dataset/interfaces.ts:128 + +*** + +### currencysymbol + +> **currencysymbol**: `string` + +Currency symbol of the record. + +#### Defined in + +src/utils/dataset/interfaces.ts:120 + +*** + +### transactioncurrencyid + +> **transactioncurrencyid**: `string` + +ID of the currency record. + +#### Defined in + +src/utils/dataset/interfaces.ts:124 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDataProvider.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDataProvider.md new file mode 100644 index 00000000..a675bb32 --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDataProvider.md @@ -0,0 +1,689 @@ +Interface for the Data Provider. + +## Properties + +### addEventListener() + +> **addEventListener**: \<`K`\>(`event`, `eventListener`) => `void` + +Allows defining a listener method that will trigger when a specific event occurs. + +#### Type Parameters + +• **K** *extends* keyof [`IDatasetEventListeners`](IDatasetEventListeners.md) + +#### Parameters + +• **event**: `K` + +• **eventListener**: [`IDatasetEventListeners`](IDatasetEventListeners.md)\[`K`\] + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:240 + +*** + +### clearChanges() + +> **clearChanges**: () => `void` + +Clears any changes in the dataset, resetting all record values to their initial state. + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:182 + +*** + +### fireEventListeners() + +> **fireEventListeners**: \<`K`\>(`event`, ...`par`) => `ReturnType`\<[`IDatasetEventListeners`](IDatasetEventListeners.md)\[`K`\]\>[] + +Fires event listeners for a specific event. + +#### Type Parameters + +• **K** *extends* keyof [`IDatasetEventListeners`](IDatasetEventListeners.md) + +#### Parameters + +• **event**: `K` + +• ...**par**: `Parameters`\<[`IDatasetEventListeners`](IDatasetEventListeners.md)\[`K`\]\> + +#### Returns + +`ReturnType`\<[`IDatasetEventListeners`](IDatasetEventListeners.md)\[`K`\]\>[] + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:245 + +*** + +### getChanges() + +> **getChanges**: () => [`IRecordChanges`](IRecordChanges.md) + +Retrieves the changes made to the records in the dataset. + +#### Returns + +[`IRecordChanges`](IRecordChanges.md) + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:177 + +*** + +### getCurrencies() + +> **getCurrencies**: () => [`ICurrency`](ICurrency.md)[] + +Gets the currencies the provider is able to work with. + +#### Returns + +[`ICurrency`](ICurrency.md)[] + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:122 + +*** + +### getDataSource() + +> **getDataSource**: () => `any` + +Gets the current Data Source. + +#### Returns + +`any` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:203 + +*** + +### getEntityName() + +> **getEntityName**: () => `string` + +Returns the name of the associated entity. + +#### Returns + +`string` + +The entity name. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:215 + +*** + +### getMetadata() + +> **getMetadata**: () => `null` \| `EntityMetadata` + +Gets the associated entity metadata. + +#### Returns + +`null` \| `EntityMetadata` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:187 + +*** + +### getRecordCurrencySymbol() + +> **getRecordCurrencySymbol**: (`record`, `columnName`) => `string` + +Retrieves the currency symbol for a specific column in a record. + +#### Parameters + +• **record**: [`IRecord`](IRecord.md) + +• **columnName**: `string` + +#### Returns + +`string` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:235 + +*** + +### getSearchQuery() + +> **getSearchQuery**: () => `string` + +Retrieves the search query string. + +#### Returns + +`string` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:225 + +*** + +### getViewId() + +> **getViewId**: () => `string` + +Returns the ID of the current view. + +#### Returns + +`string` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:220 + +*** + +### hasInvalidChanges() + +> **hasInvalidChanges**: () => `boolean` + +Whether the dataset has any records with invalid values. + +#### Returns + +`boolean` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:167 + +*** + +### isDirty() + +> **isDirty**: () => `boolean` + +Checks if the dataset has unsaved changes. + +#### Returns + +`boolean` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:172 + +*** + +### isLoading() + +> **isLoading**: () => `boolean` + +Indicates whether the data provider is currently loading. + +#### Returns + +`boolean` + +True if loading, false otherwise. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:209 + +*** + +### openDatasetItem() + +> **openDatasetItem**: (`entityReference`) => `void` + +Can be used to specify what default action happens for record opening on a specific provider. + +#### Parameters + +• **entityReference**: `EntityReference` + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:162 + +*** + +### setCurrencies() + +> **setCurrencies**: (`currencies`) => `void` + +Sets the currencies the dataset can work with. + +#### Parameters + +• **currencies**: [`ICurrency`](ICurrency.md)[] + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:127 + +*** + +### setDataSource() + +> **setDataSource**: (`dataSource`) => `void` + +Allows you to change the initial Data Source. + +#### Parameters + +• **dataSource**: `any` + +The new data source. + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:198 + +*** + +### setLoading() + +> **setLoading**: (`value`) => `void` + +Sets whether the data provider is currently loading. + +#### Parameters + +• **value**: `boolean` + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:230 + +*** + +### setMetadata() + +> **setMetadata**: (`metadata`) => `void` + +Allows you to change the initial associated entity metadata. + +#### Parameters + +• **metadata**: `EntityMetadata` + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:192 + +*** + +### setTitle() + +> **setTitle**: (`title`) => `void` + +Sets the dataset's title. + +#### Parameters + +• **title**: `string` + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:117 + +## Methods + +### getColumns() + +> **getColumns**(): [`IColumn`](IColumn.md)[] + +Returns column information, such as column names and data types. + +#### Returns + +[`IColumn`](IColumn.md)[] + +An array of column information objects. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:97 + +*** + +### getErrorMessage() + +> **getErrorMessage**(): `string` + +Returns the error message from the last data retrieval attempt, if any. + +#### Returns + +`string` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:61 + +*** + +### getFiltering() + +> **getFiltering**(): `null` \| `FilterExpression` + +Gets the current filtering. + +#### Returns + +`null` \| `FilterExpression` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:137 + +*** + +### getLinking() + +> **getLinking**(): `LinkEntityExposedExpression`[] + +Retrieves the link entity expressions used to join related entities. + +#### Returns + +`LinkEntityExposedExpression`[] + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:147 + +*** + +### getPaging() + +> **getPaging**(): `Paging` & `object` + +Returns paging information (like page number, total pages, etc.). + +#### Returns + +`Paging` & `object` + +The paging information. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:91 + +*** + +### getRawRecordData() + +> **getRawRecordData**(`recordId`): `null` \| `object` + +Retrieves the raw record data for a given record by its ID. + +#### Parameters + +• **recordId**: `string` + +#### Returns + +`null` \| `object` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:152 + +*** + +### getRecords() + +> **getRecords**(): [`IRecord`](IRecord.md)[] + +Returns the list of records. + +#### Returns + +[`IRecord`](IRecord.md)[] + +A list of records. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:85 + +*** + +### getSorting() + +> **getSorting**(): `SortStatus`[] + +Retrieves the current sorting criteria. + +#### Returns + +`SortStatus`[] + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:142 + +*** + +### getTitle() + +> **getTitle**(): `string` + +Returns the title provided by the data provider. + +#### Returns + +`string` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:112 + +*** + +### isError() + +> **isError**(): `boolean` + +Returns true if an error occurred during the last data retrieval process. + +#### Returns + +`boolean` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:56 + +*** + +### refresh() + +> **refresh**(): [`IRecord`](IRecord.md)[] \| `Promise`\<[`IRecord`](IRecord.md)[]\> + +Refreshes the records list and returns the refreshed records. + +#### Returns + +[`IRecord`](IRecord.md)[] \| `Promise`\<[`IRecord`](IRecord.md)[]\> + +A promise resolving to a list of refreshed records. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:79 + +*** + +### save() + +> **save**(`record`): `Promise`\<`void`\> + +Saves the provided record to the database. + +#### Parameters + +• **record**: [`IRecord`](IRecord.md) + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:107 + +*** + +### setColumns() + +> **setColumns**(`columns`): `void` + +Sets the columns for the dataset. + +#### Parameters + +• **columns**: `Column`[] + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:102 + +*** + +### setFiltering() + +> **setFiltering**(`filtering`): `void` + +Sets the latest filtering information. + +#### Parameters + +• **filtering**: `null` \| `FilterExpression` + +The filtering criteria, or null if no filter is applied. + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:73 + +*** + +### setLinking() + +> **setLinking**(`expr`): `void` + +Sets the link entity expressions for joining related entities. + +#### Parameters + +• **expr**: `LinkEntityExposedExpression`[] + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:132 + +*** + +### setSearchQuery() + +> **setSearchQuery**(`query`?): `void` + +Sets a new search query for filtering. + +#### Parameters + +• **query?**: `string` + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:157 + +*** + +### setSorting() + +> **setSorting**(`sorting`): `void` + +Sets the latest sorting information. + +#### Parameters + +• **sorting**: `SortStatus`[] + +The latest sorting details as an array of SortStatus objects. + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:67 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDataProviderEventListeners.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDataProviderEventListeners.md deleted file mode 100644 index 7b19ff8b..00000000 --- a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDataProviderEventListeners.md +++ /dev/null @@ -1,43 +0,0 @@ -Allows you to define callbacks that will trigger during specific events. - -## Properties - -### onCellValueChanged() - -> **onCellValueChanged**: (`record`, `columnName`) => `void` - -Triggers when column value has been changed. - -#### Parameters - -• **record**: [`IRecord`](IRecord.md) - -• **columnName**: `string` - -#### Returns - -`void` - -#### Defined in - -src/utils/dataset/data-providers/interfaces.ts:179 - -*** - -### onRecordSaved() - -> **onRecordSaved**: (`record`) => `void` - -Triggers when record has been saved. - -#### Parameters - -• **record**: [`IRecord`](IRecord.md) - -#### Returns - -`void` - -#### Defined in - -src/utils/dataset/data-providers/interfaces.ts:174 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDataProviderOptions.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDataProviderOptions.md index aa0974ad..9da7482d 100644 --- a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDataProviderOptions.md +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDataProviderOptions.md @@ -1,37 +1,18 @@ Additional options for Data Provider. +## Extended by + +- [`IFetchXmlDataProviderOptions`](IFetchXmlDataProviderOptions.md) +- [`IMemoryDataProviderOptions`](IMemoryDataProviderOptions.md) + ## Properties ### entityMetadata? -> `optional` **entityMetadata**: `DeepPartial`\<`EntityMetadata`\> +> `optional` **entityMetadata**: [`DeepPartial`](../type-aliases/DeepPartial.md)\<`EntityMetadata`\> Can be used to define/override Entity Metadata. #### Defined in -src/utils/dataset/data-providers/interfaces.ts:225 - -*** - -### title? - -> `optional` **title**: `string` - -Sets the title describing the provider. - -#### Defined in - -src/utils/dataset/data-providers/interfaces.ts:215 - -*** - -### userSettings? - -> `optional` **userSettings**: `UserSettings` \| `UserSettings` - -Only needs to be passed if the provider is running in an environment without User Settings present in window.Xrm (for example local PCF harness). - -#### Defined in - -src/utils/dataset/data-providers/interfaces.ts:220 +src/utils/dataset/data-providers/interfaces.ts:508 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDataset.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDataset.md new file mode 100644 index 00000000..6001b712 --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDataset.md @@ -0,0 +1,685 @@ +Dataset object. If a property is optional, it does not exists in Microsoft's dataset implementation. + +## Extends + +- `Omit`\<`ComponentFramework.PropertyTypes.DataSet`, `"filtering"` \| `"records"`\> + +## Properties + +### addColumn()? + +> `optional` **addColumn**: (`name`, `entityAlias`?) => `void` + +Adds column to the columnset + +#### Parameters + +• **name**: `string` + +column name to be added to the columnset + +• **entityAlias?**: `string` + +entity alias for which the column name needs to be added + +#### Returns + +`void` + +#### Inherited from + +`Omit.addColumn` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1475 + +*** + +### addEventListener()? + +> `optional` **addEventListener**: \<`K`\>(`event`, `eventListener`) => `void` + +Allows to define listener method that will trigger when specific event occurs. + +#### Type Parameters + +• **K** *extends* keyof [`IDatasetEventListeners`](IDatasetEventListeners.md) + +#### Parameters + +• **event**: `K` + +• **eventListener**: [`IDatasetEventListeners`](IDatasetEventListeners.md)\[`K`\] + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/interfaces.ts:239 + +*** + +### clearChanges()? + +> `optional` **clearChanges**: () => `void` + +Clears any changes in the dataset, resetting all record values to their initial state. + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/interfaces.ts:229 + +*** + +### columns + +> **columns**: [`IColumn`](IColumn.md)[] + +Metadata about a column in a dataset. If the column name ends with __virtual, it tells the provider it should not try to fetch column metadata from its Data Source. In this case, you need to specify all the necessary metadata yourself. If a property is optional, it does not exists in Microsoft's dataset implementation. + +#### Overrides + +`Omit.columns` + +#### Defined in + +src/utils/dataset/interfaces.ts:145 + +*** + +### error + +> **error**: `boolean` + +True if encountered error while data retrieval + +#### Inherited from + +`Omit.error` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1485 + +*** + +### errorMessage + +> **errorMessage**: `string` + +The error message associated with the last encountered error, if applicable + +#### Inherited from + +`Omit.errorMessage` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1490 + +*** + +### filtering + +> **filtering**: `Omit`\<`Filtering`, `"getFilter"`\> & `object` + +Filter state for a dataset. + +#### Type declaration + +##### getFilter() + +> **getFilter**: () => `null` \| `FilterExpression` + +###### Returns + +`null` \| `FilterExpression` + +#### Defined in + +src/utils/dataset/interfaces.ts:138 + +*** + +### getChanges()? + +> `optional` **getChanges**: () => [`IRecordChanges`](IRecordChanges.md) + +Retrieves the changes made to the records in the dataset. Change occures when `setValue` API on record is used to change it's initial value. +Only dirty changes are kept, meaning if later call of `setValue` resets the value to it's original state, it's change reference is removed. + +#### Returns + +[`IRecordChanges`](IRecordChanges.md) + +#### Defined in + +src/utils/dataset/interfaces.ts:224 + +*** + +### getDataSource()? + +> `optional` **getDataSource**: () => `any` + +Gets the current Data Source. + +#### Returns + +`any` + +#### Defined in + +src/utils/dataset/interfaces.ts:178 + +*** + +### getMetadata() + +> **getMetadata**: () => `null` \| `EntityMetadata` + +Gets the associated entity metadata. + +#### Returns + +`null` \| `EntityMetadata` + +#### Defined in + +src/utils/dataset/interfaces.ts:163 + +*** + +### getSearchQuery()? + +> `optional` **getSearchQuery**: () => `null` \| `string` + +Gets Quick find search query. + +#### Returns + +`null` \| `string` + +#### Defined in + +src/utils/dataset/interfaces.ts:208 + +*** + +### hasInvalidChanges()? + +> `optional` **hasInvalidChanges**: () => `boolean` + +Whether the dataset has any records with invalid values. + +#### Returns + +`boolean` + +#### Defined in + +src/utils/dataset/interfaces.ts:213 + +*** + +### isDirty()? + +> `optional` **isDirty**: () => `boolean` + +Checks if the dataset has unsaved changes. Change can occure by using the `setValue` API on record. + +#### Returns + +`boolean` + +#### Defined in + +src/utils/dataset/interfaces.ts:218 + +*** + +### linking + +> **linking**: `Linking` + +Related entity info + +#### Inherited from + +`Omit.linking` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1500 + +*** + +### loading + +> **loading**: `boolean` + +Indicate if the dataset property is in loading state or not + +#### Inherited from + +`Omit.loading` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1505 + +*** + +### paging + +> **paging**: `Paging` & `object` + +Paging state for a dataset + +#### Type declaration + +##### loadExactPage() + +> **loadExactPage**: (`pageNumber`, `save`?) => `void` + +###### Parameters + +• **pageNumber**: `number` + +• **save?**: `boolean` + +###### Returns + +`void` + +##### pageNumber + +> **pageNumber**: `number` + +#### Overrides + +`Omit.paging` + +#### Defined in + +src/utils/dataset/interfaces.ts:150 + +*** + +### records + +> **records**: `object` + +Map of IDs to the full record object. + +#### Index Signature + + \[`key`: `string`\]: [`IRecord`](IRecord.md) + +#### Defined in + +src/utils/dataset/interfaces.ts:158 + +*** + +### render()? + +> `optional` **render**: () => `void` + +Rerenders the Dataset Control + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/interfaces.ts:198 + +*** + +### save()? + +> `optional` **save**: () => `Promise`\<`void`\> + +Saves all unsaved changes in dataset. + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +src/utils/dataset/interfaces.ts:188 + +*** + +### setColumns()? + +> `optional` **setColumns**: (`columns`) => `void` + +Sets the columns in the dataset. + +#### Parameters + +• **columns**: [`IColumn`](IColumn.md)[] + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/interfaces.ts:234 + +*** + +### setCurrencies()? + +> `optional` **setCurrencies**: (`currencies`) => `void` + +Sets the currencies the dataset can work with. + +#### Parameters + +• **currencies**: [`ICurrency`](ICurrency.md)[] + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/interfaces.ts:168 + +*** + +### setDataSource()? + +> `optional` **setDataSource**: (`dataSource`) => `void` + +Allows you to change the initial Data Source. + +#### Parameters + +• **dataSource**: `any` + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/interfaces.ts:183 + +*** + +### setMetadata()? + +> `optional` **setMetadata**: (`metadata`) => `void` + +Allows you to change the initial associated entity metadata. + +#### Parameters + +• **metadata**: `EntityMetadata` + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/interfaces.ts:193 + +*** + +### setSearchQuery()? + +> `optional` **setSearchQuery**: (`query`) => `void` + +Sets quick find seach query. + +#### Parameters + +• **query**: `string` + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/interfaces.ts:203 + +*** + +### setTitle()? + +> `optional` **setTitle**: (`title`) => `void` + +Sets the dataset's title. + +#### Parameters + +• **title**: `string` + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/interfaces.ts:173 + +*** + +### sortedRecordIds + +> **sortedRecordIds**: `string`[] + +IDs of the records in the dataset, order by the query response result + +#### Inherited from + +`Omit.sortedRecordIds` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1522 + +*** + +### sorting + +> **sorting**: `SortStatus`[] + +The sorting status for the current query. + +#### Inherited from + +`Omit.sorting` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1527 + +## Methods + +### clearSelectedRecordIds() + +> **clearSelectedRecordIds**(): `void` + +Clear selected record ids list + +#### Returns + +`void` + +#### Inherited from + +`Omit.clearSelectedRecordIds` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1532 + +*** + +### getSelectedRecordIds() + +> **getSelectedRecordIds**(): `string`[] + +Retrieves all selected record ids + +#### Returns + +`string`[] + +#### Inherited from + +`Omit.getSelectedRecordIds` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1537 + +*** + +### getTargetEntityType() + +> **getTargetEntityType**(): `string` + +Get DataSet target entity logical name + +#### Returns + +`string` + +#### Inherited from + +`Omit.getTargetEntityType` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1542 + +*** + +### getTitle() + +> **getTitle**(): `string` + +Retrieves the view display name used by the dataset property + +#### Returns + +`string` + +#### Inherited from + +`Omit.getTitle` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1547 + +*** + +### getViewId() + +> **getViewId**(): `string` + +Gets Id of view used by the dataset property + +#### Returns + +`string` + +#### Inherited from + +`Omit.getViewId` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1552 + +*** + +### openDatasetItem() + +> **openDatasetItem**(`entityReference`): `void` + +Open dataSet item for a given EntityReference. It will check if there is a command with command button id "Mscrm.OpenRecordItem". +If there is, it will execute the command, otherwise it will just navigate to the associated form of the entityReference + +#### Parameters + +• **entityReference**: `EntityReference` + +entity reference + +#### Returns + +`void` + +#### Inherited from + +`Omit.openDatasetItem` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1559 + +*** + +### refresh() + +> **refresh**(): `void` + +Refreshes the dataset based on filters, sorting, linking, new column. New data will be pushed to control in another 'updateView' cycle. + +#### Returns + +`void` + +#### Inherited from + +`Omit.refresh` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1564 + +*** + +### setSelectedRecordIds() + +> **setSelectedRecordIds**(`ids`): `void` + +Set the ids of the selected records + +#### Parameters + +• **ids**: `string`[] + +List of recordId's + +#### Returns + +`void` + +#### Inherited from + +`Omit.setSelectedRecordIds` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1570 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDatasetEventListeners.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDatasetEventListeners.md index 1a1ed9ab..81f5ac0a 100644 --- a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDatasetEventListeners.md +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IDatasetEventListeners.md @@ -2,16 +2,30 @@ Allows you to define callbacks that will trigger during specific events. ## Properties +### onChangesCleared() + +> **onChangesCleared**: () => `void` + +Triggers when dataset changes get cleared. + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/interfaces.ts:42 + +*** + ### onDatasetItemOpened() -> **onDatasetItemOpened**: (`dataset`, `entityReference`) => `void` +> **onDatasetItemOpened**: (`entityReference`) => `void` -Triggers when record has been opened by a PCF. +Triggers when record has been opened. If specified, it overrides the native behavior. #### Parameters -• **dataset**: [`IDataset`](IDataset.md) - • **entityReference**: `EntityReference` #### Returns @@ -20,19 +34,35 @@ Triggers when record has been opened by a PCF. #### Defined in -src/utils/dataset/interfaces.ts:15 +src/utils/dataset/interfaces.ts:11 *** ### onNewDataLoaded() -> **onNewDataLoaded**: (`dataset`) => `void` +> **onNewDataLoaded**: () => `void` + +Triggers when new data has been loaded, for example after a `refresh` or `loadExactPage` events. + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/interfaces.ts:16 + +*** -Triggers when new load has been loaded, for example after a `refresh` or `loadExactPage` events. +### onPageSizeChanged() + +> **onPageSizeChanged**: (`pageSize`) => `void` + +Triggers when page size changes. #### Parameters -• **dataset**: [`IDataset`](IDataset.md) +• **pageSize**: `number` #### Returns @@ -40,19 +70,59 @@ Triggers when new load has been loaded, for example after a `refresh` or `loadEx #### Defined in -src/utils/dataset/interfaces.ts:20 +src/utils/dataset/interfaces.ts:47 *** -### onRecordsSelected() +### onRecordColumnValueChanged() -> **onRecordsSelected**: (`dataset`, `selectedRecordIds`) => `void` +> **onRecordColumnValueChanged**: (`record`, `columnName`) => `void` -Triggers when some record/s has been selected by the PCF. +Triggers when record column value has been changed. #### Parameters -• **dataset**: [`IDataset`](IDataset.md) +• **record**: [`IRecord`](IRecord.md) + +• **columnName**: `string` + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/interfaces.ts:27 + +*** + +### onRecordLoaded() + +> **onRecordLoaded**: (`record`) => `void` + +Triggers when new record has been loaded, for example after a `refresh` or `loadExactPage` events. Can be used to register expressions on a record. + +#### Parameters + +• **record**: [`IRecord`](IRecord.md) + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/interfaces.ts:22 + +*** + +### onRecordsSelected() + +> **onRecordsSelected**: (`selectedRecordIds`) => `void` + +Triggers when some record/s has been selected. + +#### Parameters • **selectedRecordIds**: `string`[] @@ -62,4 +132,24 @@ Triggers when some record/s has been selected by the PCF. #### Defined in -src/utils/dataset/interfaces.ts:10 +src/utils/dataset/interfaces.ts:32 + +*** + +### onSave() + +> **onSave**: (`record`) => `Promise`\<`void`\> + +Allows you to specify custom saving logic. If specified, the native `onSave` code in provider will not execute. + +#### Parameters + +• **record**: [`IRecord`](IRecord.md) + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +src/utils/dataset/interfaces.ts:37 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IFetchXmlDataProviderOptions.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IFetchXmlDataProviderOptions.md new file mode 100644 index 00000000..78c10a95 --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IFetchXmlDataProviderOptions.md @@ -0,0 +1,21 @@ +DataProviderOptions for FetchXmlDataProvider. + +## Extends + +- [`IDataProviderOptions`](IDataProviderOptions.md) + +## Properties + +### entityMetadata? + +> `optional` **entityMetadata**: [`DeepPartial`](../type-aliases/DeepPartial.md)\<`EntityMetadata`\> + +Can be used to define/override Entity Metadata. + +#### Inherited from + +[`IDataProviderOptions`](IDataProviderOptions.md).[`entityMetadata`](IDataProviderOptions.md#entitymetadata) + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:508 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IFieldChange.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IFieldChange.md new file mode 100644 index 00000000..70fab852 --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IFieldChange.md @@ -0,0 +1,49 @@ +Represents changes made on record column value. + +## Properties + +### columnName + +> **columnName**: `string` + +Name of the column. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:430 + +*** + +### currentValue + +> **currentValue**: `any` + +Current value of the column after changes have been made. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:424 + +*** + +### isValid + +> **isValid**: `boolean` + +Whether the change done to the column is valid. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:434 + +*** + +### originalValue + +> **originalValue**: `any` + +Original value of the column (as it came when the data was first fetched from the server). + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:420 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IFieldValidationResult.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IFieldValidationResult.md new file mode 100644 index 00000000..960ccd28 --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IFieldValidationResult.md @@ -0,0 +1,29 @@ +Validation result for record column value. + +## Extended by + +- [`IColumnInfo`](IColumnInfo.md) + +## Properties + +### error + +> **error**: `boolean` + +Returns true if the record column value has invalid value. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:445 + +*** + +### errorMessage + +> **errorMessage**: `string` + +Error message for invalid record column value. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:449 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IMemoryDataProviderOptions.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IMemoryDataProviderOptions.md new file mode 100644 index 00000000..f2e1c485 --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IMemoryDataProviderOptions.md @@ -0,0 +1,27 @@ +MemoryDataProvider options. + +## Extends + +- [`IDataProviderOptions`](IDataProviderOptions.md) + +## Properties + +### entityMetadata + +> **entityMetadata**: [`DeepPartial`](../type-aliases/DeepPartial.md)\<`EntityMetadata`\> & `object` + +Can be used to define/override Entity Metadata. + +#### Type declaration + +##### PrimaryIdAttribute + +> **PrimaryIdAttribute**: `string` + +#### Overrides + +[`IDataProviderOptions`](IDataProviderOptions.md).[`entityMetadata`](IDataProviderOptions.md#entitymetadata) + +#### Defined in + +src/utils/dataset/data-providers/memory-provider/MemoryDataProvider.ts:12 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IRecord.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IRecord.md new file mode 100644 index 00000000..3b0d84d5 --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IRecord.md @@ -0,0 +1,274 @@ +Base interface for dataset record result. If a property is optional, it does not exists in Microsoft's dataset implementation. + +## Extends + +- `Omit`\<`ComponentFramework.PropertyHelper.DataSetApi.EntityRecord`, `"getFormattedValue"`\> + +## Properties + +### clearChanges()? + +> `optional` **clearChanges**: (`columnName`?) => `void` + +Clears any changes in the record, resetting all record values to their initial state. + +#### Parameters + +• **columnName?**: `string` + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:314 + +*** + +### expressions? + +> `optional` **expressions**: [`IRecordExpressions`](IRecordExpressions.md) + +Allows you to set expressions for certain record properties. For example, you can specify a validation expression to create a custom validator for a column. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:293 + +*** + +### getChanges()? + +> `optional` **getChanges**: (`columnName`?) => [`IFieldChange`](IFieldChange.md)[] + +Retrieves the changes made to the record. Change occurs when `setValue` API on record is used to change its initial value. +Only dirty changes are kept, meaning if a later call of `setValue` resets the value to its original state, the change reference is removed. + +#### Parameters + +• **columnName?**: `string` + +#### Returns + +[`IFieldChange`](IFieldChange.md)[] + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:309 + +*** + +### getColumnInfo() + +> **getColumnInfo**: (`columnName`) => [`IColumnInfo`](IColumnInfo.md) + +Provides column information. + +#### Parameters + +• **columnName**: `string` + +#### Returns + +[`IColumnInfo`](IColumnInfo.md) + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:276 + +*** + +### getCurrencySymbol()? + +> `optional` **getCurrencySymbol**: (`columnName`) => `string` + +Gets currency symbol for a given column. + +#### Parameters + +• **columnName**: `string` + +#### Returns + +`string` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:298 + +*** + +### getRawData()? + +> `optional` **getRawData**: () => `null` \| `object` + +Retrieves the raw record data. + +#### Returns + +`null` \| `object` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:303 + +*** + +### getValue() + +> **getValue**: (`columnName`) => `any` + +Get the raw value of the record's column. + +#### Parameters + +• **columnName**: `string` + +#### Returns + +`any` + +#### Overrides + +`Omit.getValue` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:266 + +*** + +### isDirty() + +> **isDirty**: (`columnName`?) => `boolean` + +Checks if the record has unsaved changes. Change can occur by using the `setValue` API on the record. + +#### Parameters + +• **columnName?**: `string` + +#### Returns + +`boolean` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:286 + +*** + +### save() + +> **save**: () => `Promise`\<`void`\> + +Saves the record. + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:271 + +*** + +### setValue() + +> **setValue**: (`columnName`, `value`) => `void` + +Sets the value of a given column. + +#### Parameters + +• **columnName**: `string` + +• **value**: `any` + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:261 + +## Methods + +### getFormattedValue() + +> **getFormattedValue**(`columnName`): `null` \| `string` + +Get the current formatted value of this record column. + +#### Parameters + +• **columnName**: `string` + +Column name of the record + +#### Returns + +`null` \| `string` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:256 + +*** + +### getNamedReference() + +> **getNamedReference**(): `EntityReference` + +Get the object that encapsulates an Entity Reference as a plain object + +#### Returns + +`EntityReference` + +#### Inherited from + +`Omit.getNamedReference` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1886 + +*** + +### getRecordId() + +> **getRecordId**(): `string` + +Get the record ID + +#### Returns + +`string` + +#### Inherited from + +`Omit.getRecordId` + +#### Defined in + +node\_modules/@types/powerapps-component-framework/componentframework.d.ts:1875 + +*** + +### isValid() + +> **isValid**(): `boolean` + +Whether the record is valid. + +#### Returns + +`boolean` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:281 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IRecordChange.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IRecordChange.md new file mode 100644 index 00000000..677403ef --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IRecordChange.md @@ -0,0 +1,25 @@ +Interface for changes in record column values. + +## Properties + +### columns + +> **columns**: [`IFieldChange`](IFieldChange.md)[] + +Array of columns with changes. + +#### Defined in + +src/utils/dataset/interfaces.ts:110 + +*** + +### record + +> **record**: [`IRecord`](IRecord.md) + +Pointer to the record instance these changes relate to. + +#### Defined in + +src/utils/dataset/interfaces.ts:106 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IRecordChanges.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IRecordChanges.md new file mode 100644 index 00000000..0d7c7b34 --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IRecordChanges.md @@ -0,0 +1,5 @@ +Map of all records with pending column value changes. + +## Indexable + + \[`recordId`: `string`\]: [`IRecordChange`](IRecordChange.md) diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IRecordExpressions.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IRecordExpressions.md new file mode 100644 index 00000000..8eccf23b --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IRecordExpressions.md @@ -0,0 +1,124 @@ +Can be used to specify record expressions. These can be used to modify the record behavior during runtime. + +## Properties + +### setCurrencySymbolExpression() + +> **setCurrencySymbolExpression**: (`columnName`, `currencySymbolExpression`) => `void` + +Allows you to specify a currency symbol for a given column. + +#### Parameters + +• **columnName**: `string` + +• **currencySymbolExpression** + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:352 + +*** + +### setDisabledExpression() + +> **setDisabledExpression**: (`columnName`, `disabledExpression`) => `void` + +Allows you to specify whether a column is read-only (disabled) or editable (not disabled). + +#### Parameters + +• **columnName**: `string` + +• **disabledExpression** + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:342 + +*** + +### setRequiredLevelExpression() + +> **setRequiredLevelExpression**: (`columnName`, `requiredLevelExpression`) => `void` + +Allows you to specify the requirement level for a given column. + +#### Parameters + +• **columnName**: `string` + +• **requiredLevelExpression** + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:347 + +*** + +### setValidationExpression() + +> **setValidationExpression**: (`columnName`, `validator`) => `void` + +Allows you to create a custom validator for a column. + +#### Parameters + +• **columnName**: `string` + +• **validator** + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:331 + +*** + +### setValueExpression() + +> **setValueExpression**: (`columnName`, `valueExpression`) => `void` + +Sets an expression as the column's value. The expression is evaluated each time `getValue` is called, with the resulting value used as the column's value. +Setting a value expression does trigger unsaved changes as it is treated as if it were the column's original value. + +#### Parameters + +• **columnName**: `string` + +• **valueExpression** + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:337 + +*** + +### ui + +> **ui**: [`IRecordUiExpression`](IRecordUiExpression.md) + +Expressions to manipulate UI. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:326 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IRecordUiExpression.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IRecordUiExpression.md new file mode 100644 index 00000000..4ba1b626 --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/IRecordUiExpression.md @@ -0,0 +1,97 @@ +Can be used to specify record UI expressions. These can be used to modify the record UI during runtime. + +## Properties + +### setCellEditorParametersExpression() + +> **setCellEditorParametersExpression**: (`columnName`, `parameterExpression`) => `void` + +Allows you to override parameters that are passed to cell editor control. + +#### Parameters + +• **columnName**: `string` + +• **parameterExpression** + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:409 + +*** + +### setHeightExpression() + +> **setHeightExpression**: (`columnName`, `heightExpression`) => `void` + +Sets the height for individual cells, which determines the height of the entire row. + +- If you specify a height for only one cell, the entire row will adjust to that cell's height. +- If multiple cells in a row have specified heights, the row height will match the tallest cell. + +The provided expression accepts two parameters: + +- `columnWidth` - The current width of the column where the cell is being rendered. +- `rowHeight` - The default row height, used if no cells in the row specify a custom height. + +#### Parameters + +• **columnName**: `string` + +• **heightExpression** + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:404 + +*** + +### setLoadingExpression() + +> **setLoadingExpression**: (`columnName`, `loadingExpression`) => `void` + +Allows you to specify whether the given column is being loaded or not. Useful if you want to show the cell only when some asynchronous operation finishes. + +#### Parameters + +• **columnName**: `string` + +• **loadingExpression** + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:390 + +*** + +### setNotificationsExpression() + +> **setNotificationsExpression**: (`columnName`, `notificationExpression`) => `void` + +Allows you to add notifications to a column. Notifications appear as a set of buttons next to the column formatted value. + +#### Parameters + +• **columnName**: `string` + +• **notificationExpression** + +#### Returns + +`void` + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:385 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/ISecurityValues.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/ISecurityValues.md new file mode 100644 index 00000000..23d163bb --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/interfaces/ISecurityValues.md @@ -0,0 +1,49 @@ +Security values for record column. + +## Properties + +### editable + +> **editable**: `boolean` + +Whether this value is meant to be editable in the current context. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:27 + +*** + +### readable + +> **readable**: `boolean` + +Whether this value is meant to be readable in the current context. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:33 + +*** + +### requiredLevel? + +> `optional` **requiredLevel**: `RequirementLevel` + +Required level for field in the current context. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:45 + +*** + +### secured + +> **secured**: `boolean` + +Whether this field has security rules applied to it. + +#### Defined in + +src/utils/dataset/data-providers/interfaces.ts:39 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/type-aliases/DeepPartial.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/type-aliases/DeepPartial.md new file mode 100644 index 00000000..5515b08b --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/type-aliases/DeepPartial.md @@ -0,0 +1,11 @@ +> **DeepPartial**\<`T`\>: `{ [P in keyof T]?: T[P] extends object ? DeepPartial : T[P] }` + +Makes all properties optional. + +## Type Parameters + +• **T** + +## Defined in + +src/utils/dataset/data-providers/interfaces.ts:497 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/type-aliases/IAttributeMetadata.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/type-aliases/IAttributeMetadata.md new file mode 100644 index 00000000..7bbc6979 --- /dev/null +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/API/type-aliases/IAttributeMetadata.md @@ -0,0 +1,15 @@ +> **IAttributeMetadata**: `Omit`\<`Xrm.Metadata.AttributeMetadata`, `"OptionSet"`\> & `object` + +Type to hold the Attribute metadata as part of the EntityMetadata + +## Type declaration + +### OptionSet + +> **OptionSet**: `Omit`\<`Xrm.Metadata.OptionMetadata`, `"Label"`\> & `object`[] + +Type to hold the optionset metadata as part of the EntityMetadata + +## Defined in + +src/utils/dataset/interfaces.ts:70 diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/general.md b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/general.md index d2380b57..e61b95b2 100644 --- a/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/general.md +++ b/src/en/developer-guide/applications/controls/VirtualDataset/ClientExtensibility/general.md @@ -3,71 +3,265 @@ Author: Dominik Brych --- # Client Extensibility -You can extend the PCF functionalities by acessing it's API from a client script. You can access the API by registering an [`addOnOutputChange`](https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/controls/addonoutputchange) callback. -When your callback fires, you can retrieve the dataset instance. You can then use it's API to manipulate the control and register event handlers. Please refer to our [API docs](API/globals.md) to learn more. +You can extend the functionalities of the control by accessing it's API through a client script. To access the API, you need to register an [`addOnOutputChange`](https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/controls/addonoutputchange) callback on the control. +When the callback is triggered, you can retrieve the dataset instance. From there, you can use its API to manipulate the control and register event handlers. -
-Client Script Example ```javascript -let notificationIds = []; function onFormLoad(executionContext) { const formContext = executionContext.getFormContext(); const control = formContext.getControl('talxis_clientextensibilitybindingfield'); control.addOnOutputChange((executionContext) => { const control = executionContext.getFormContext().getControl('talxis_clientextensibilitybindingfield'); const dataset = control.getOutputs()['talxis_clientextensibilitybindingfield.fieldControl.DatasetControl'].value; - //init, settings you apply to dataset here will be applied before first data fetch - dataset.addEventListener('onNewDataLoaded', (dataset) => { - Object.values(dataset.records).map(record => { - record.setValue('talxis_sum__virtual', calculateSum(record)); - }) - dataset.render(); - }); - dataset.addEventListener('onRecordsSelected', (dataset, ids) => { - notificationIds.map(id => Xrm.App.clearGlobalNotification(id)); - notificationIds = []; - ids.map(id => { - const notification = - { - type: 2, - level: 1, - message: `Record ${dataset.records[id].getFormattedValue('talxis_name')} with id ${id} has been selected.` - } - - Xrm.App.addGlobalNotification(notification).then( - function success(result) { - notificationIds.push(result); - } - ); - }) + + dataset.addEventListener('onRecordLoaded', (record) => { + //register record expressions + }) + + dataset.addEventListener('onDatasetItemOpened', (entityReference) => { + openAlertDialog(entityReference); }); - dataset.addEventListener('onDatasetItemOpened', (dataset, entityReference) => { - const alertStrings = { text: `Sample client script logic for opening of record ${entityReference.name}`, title: "Open" }; - const alertOptions = { height: 120, width: 260 }; - Xrm.Navigation.openAlertDialog(alertStrings, alertOptions); + dataset.addEventListener('onRecordsSelected', (ids) => { + showSelectedRecordsNotifications(ids, dataset) }); + }) +} +``` - dataset.getDataProvider().addEventListener('onCellValueChanged', (record, columnName) => { - switch (columnName) { - case 'talxis_decimal': - case 'talxis_wholenone': { - record.setValue('talxis_sum__virtual', calculateSum(record)); - dataset.render(); +## Record Expressions + +Record expressions allow you to dynamically manipulate specific cells within a record (row) by defining a callback function for certain events. Each expression is tied to a specific record cell. The API currently supports setting expressions for the following types of customizations: + +### Dynamic Cell Values + +If specified, the control will use it's returned value as cell's value. You can think of it as setting a formula on a cell in Excel. Unlike `setValue`, speficying this callback does not trigger any changes on the dataset, even if the value is different between renders. This means the user will not see any pending changes, unless they directly manipulate the cell value. If they do, that value will take precedence over the expression. If the user removes the change, the expression will be used again. + +```javascript +dataset.addEventListener('onRecordLoaded', (record) => { + //value of this cell will always be the sum of talxis_decimal and + //talxis_wholenone + record.expressions?.setValueExpression('talxis_sum__virtual', () => { + const value1 = record.getValue('talxis_decimal') ?? 0; + const value2 = record.getValue('talxis_wholenone') ?? 0; + return value1 + value2; + }) +}) +``` + +> **_NOTE:_** When calculating the value, **DO NOT** call `getValue` on the same record and cell. If you do, you will end up in an infinite loop. + +### Cell Validation + +You can define custom validation logic to supplement the built-in validation. When triggered, your logic will run alongside the native validation. If your custom validation fails, the user will not be able to save their changes. You can (should) also provide a custom error message that will be displayed in the UI. + +```javascript +dataset.addEventListener('onRecordLoaded', (record) => { + //validation for this cell will fail if it's value is <= 0 + record.expressions?.setValidationExpression('talxis_sum__virtual', () => { + const value = record.getValue('talxis_sum__virtual') ?? 0; + return { + error: value <= 0, + errorMessage: value <= 0 ? 'Has to be positive number!' : '' + } + }) +}) +``` + +### Cell Disabling + +When a control's `EnableEditing` attribute is set to true and a column's `IsValidForUpdate` property is also true, all cells within that column are editable by default. However, there may be cases where you want to disable editing for specific cells. This can be achieved by defining a disabled expression for those cells. + +```javascript +record.expressions?.setDisabledExpression('talxis_name', () => { + //disable editing if the value ends with '7' + if (record.getValue('talxis_name')?.endsWith('7')) { + return true; + } + return false; +}) +``` +![Dynamic Row Heights](/.attachments/applications/Controls/VirtualDataset/disabled.gif) + +### Cell Editor Parameters + +You can tailor the parameters of the Cell Editor control to meet your specific requirements. For instance, if you need to use a custom viewId for a Lookup, you can achieve this by implementing your own `getAllViews` method to return the desired viewId + +> **_NOTE:_** Passed parameters always adhere to the Base Control interface for the specified data type. + +```javascript +dataset.addEventListener('onRecordLoaded', (record) => { + record.expressions?.ui.setCellEditorParametersExpression('transactioncurrencyid', (parameters) => { + return { + ...parameters, + value: { + ...parameters.value, + getAllViews: (entityName) => { + return [{ + isDefault: true, + viewId: 'a2420357-be1d-4480-8da8-0ee8c33cd95a' + }] } } - }); - dataset.getDataProvider().addEventListener('onRecordSaved', (record) => { - console.log(record.getRecordId(), 'has just been saved'); - }); + } }) -} +}) +``` +> **_NOTE:_** Never directly manipulate the passed parameters. **Always use** spread operator and return a new object! -const calculateSum = (record) => { - const value1 = record.getValue('talxis_decimal') ?? 0; - const value2 = record.getValue('talxis_wholenone') ?? 0; - return value1 + value2; -} + + +### Dynamic Row Height + +You can override the height of a cell in a record by specifying this expression. Your callback function will also receive the current width of the cell and the default row height used by the control. If you set a custom height for a cell, the tallest cell in the row will determine the row's overall height. The remaining cells will automatically adjust to fill the available space. + +```javascript +dataset.addEventListener('onRecordLoaded', (record) => { + record.expressions?.ui.setHeightExpression('talxis_multiline__virtual', (columnWidth, rowHeight) => { + const value = record.getValue('talxis_multiline__virtual') ?? ""; + const length = value.length; + let minHeight = rowHeight; + let maxHeight = 200; + if (length === 0) { + return undefined; + } + const avgCharWidth = 14 * 0.5; + + // Calculate the max number of characters that fit in one line + const charsPerLine = Math.floor(columnWidth / avgCharWidth); + + // Calculate the number of lines needed + const numLines = Math.ceil(value.length / charsPerLine); + + // Calculate the height based on the number of lines + const lineHeight = 14 * 1.2; // 1.2 multiplier for line spacing + let totalHeight = numLines * lineHeight; + if (totalHeight < minHeight) { + totalHeight = minHeight; + } + if (totalHeight > maxHeight) { + totalHeight = maxHeight + } + + return Math.ceil(totalHeight); + }) +}) +``` + +> **_NOTE:_** Code for height calculation is AI generated and might need some revision to work correctly in all cases. +
+ +The above code dynamically calculates the required row height to accommodate the content of a cell with multiline input. This ensures that the text is fully visible without truncation, as the row height automatically adjusts to fit the length of the text. + +![Dynamic Row Heights](/.attachments/applications/Controls/VirtualDataset/dynamic_height.gif) + +### Cell Loading + +You can use this expression to tell the control if specific cell should appear as being loaded. This is usefull if you need to do some async operation before the cell value can be calculated. + +```javascript +dataset.addEventListener('onRecordLoaded', (record) => { + //will put all cells into a loading state. + for (const column of dataset.columns) { + record.expressions?.ui.setLoadingExpression(column.name, () => { + return true; + }) + } +}) +``` +![Loading](/.attachments/applications/Controls/VirtualDataset/loading.gif) + +### Cell Notifications +You can enhance specific cells by adding buttons, each capable of executing multiple actions. +If a button is linked to a single action, clicking it will immediately trigger the action. When multiple actions are assigned, clicking the button will display a pop-up menu, allowing the user to select the desired action. +Additionally, notifications can be assigned to an empty virtual column, effectively creating an inline ribbon. + +```javascript +record.expressions?.ui.setNotificationsExpression('talxis_name', () => { + return [{ + uniqueId: 'action1', + iconName: 'LightningBolt', + title: 'Single Action', + actions: [{ + actions: [] + }] + }, + { + uniqueId: 'action2', + iconName: 'LightningBolt', + title: 'Two Actions', + messages: ['Choose one of the following actions:'], + actions: [{ + message: 'Action 1', + actions: [() => alert('Action 1')] + }, { + message: 'Action 2', + actions: [() => alert('Action 2')] + }] + }, + { + uniqueId: 'action3', + iconName: 'LightningBolt', + title: 'Multiple Actions', + messages: ['Choose one of the following actions:'], + actions: [{ + message: 'Action 1', + actions: [() => alert('Action 1')] + }, { + message: 'Action 2', + actions: [() => alert('Action 2')] + }, + { + message: 'Action 3', + actions: [() => alert('Action 3')] + }, { + message: 'Action 4', + actions: [() => alert('Action 4')] + } + ] + } + ]; +}) +``` +![Dynamic Row Heights](/.attachments/applications/Controls/VirtualDataset/ribbon.gif) + + +Notifications can be useful tool for extending the control functionality. For instance, they can be utilized to create an interactive counter, as demonstrated in the following example: + +```javascript +record.expressions?.ui.setNotificationsExpression('talxis_wholenone', () => { + return [{ + uniqueId: 'increment', + iconName: 'Add', + compact: true, + title: 'Increment', + actions: [{ + actions: [() => { + const value = record.getValue(columnName) ?? 0; + record.setValue(columnName, value + 1); + dataset.render(); + }] + }] + }, + { + uniqueId: 'decrement', + iconName: 'Remove', + compact: true, + title: 'Decrement', + actions: [{ + actions: [() => { + const value = record.getValue(columnName) ?? 0; + record.setValue(columnName, value - 1); + dataset.render(); + }] + }] + } + ]; +}) ``` - \ No newline at end of file + +![Dynamic Row Heights](/.attachments/applications/Controls/VirtualDataset/counter.gif) + + + diff --git a/src/en/developer-guide/applications/controls/VirtualDataset/general.md b/src/en/developer-guide/applications/controls/VirtualDataset/general.md index e517f279..653f63a3 100644 --- a/src/en/developer-guide/applications/controls/VirtualDataset/general.md +++ b/src/en/developer-guide/applications/controls/VirtualDataset/general.md @@ -8,10 +8,11 @@ Virtual Dataset allows you to bind a Dataset Base Control to a field while provi - **Sorting** - **Filtering** - **Paging** -- **Editing** +- **Validation** +- **Editing (including linked entities)** - **Quick Find** -![Attachments Grid Displayed On Form](/.attachments/applications/Controls/virtualdataset.png) +![Attachments Grid Displayed On Form](/.attachments/applications/Controls/VirtualDataset/virtualdataset.png) NOTE: Due to a bug in Power Apps maker, this PCF can only be bind manually through Form Xml! @@ -104,7 +105,7 @@ Memory Data Provider expects a stringified JSON array as input. The array should
-> **_NOTE:_** You always need to include the @OData and @Microsoft fields for lookups. You should not do that for any other Data Types (dates, optionsets etc.), we calculate these values on client automatically +> **_NOTE:_** You always need to include the @OData and @Microsoft fields for lookups. This is not needed for other Data Types as we calculate these values automatically on client. ## Columns @@ -238,7 +239,7 @@ Entity Metadata binding allows you to define/override any [Xrm Entity Metadata]( true - Entity Metadata + EntityMetadata Optional property allowing you to override/define Entity Metadata Multiple {"DisplayCollectionName": "Custom Collection Name"} @@ -255,6 +256,15 @@ Entity Metadata binding allows you to define/override any [Xrm Entity Metadata]( input false + + RowHeight + Sets a custom height for rows. + Whole.None + 42 + N/A + input + false + EnableEditing Enable or disable editing functionality in the control. @@ -327,6 +337,15 @@ Entity Metadata binding allows you to define/override any [Xrm Entity Metadata]( input false + + EnableChangeEditor + Whether the user can display a list of all their changes. + Enum ("Yes" | "No") + "Yes" + N/A + input + false +