diff --git a/CardViewer/ControlManifest.Input.xml b/CardViewer/ControlManifest.Input.xml index 6f537eb..9668c76 100644 --- a/CardViewer/ControlManifest.Input.xml +++ b/CardViewer/ControlManifest.Input.xml @@ -1,6 +1,6 @@  - + diff --git a/CardViewer/assets/configuration.png b/CardViewer/assets/configuration.png new file mode 100644 index 0000000..9fd6048 Binary files /dev/null and b/CardViewer/assets/configuration.png differ diff --git a/CardViewer/assets/demo.png b/CardViewer/assets/demo.png new file mode 100644 index 0000000..defb455 Binary files /dev/null and b/CardViewer/assets/demo.png differ diff --git a/CardViewer/index.ts b/CardViewer/index.ts index 58cde03..e5b3f38 100644 --- a/CardViewer/index.ts +++ b/CardViewer/index.ts @@ -1,6 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { IInputs, IOutputs } from "./generated/ManifestTypes"; -import * as mockData from "./fakeJson.json"; import CardView from "./Card"; import * as React from "react"; import * as ReactDOM from "react-dom"; @@ -47,10 +46,9 @@ export class CardViewer implements ComponentFramework.StandardControl, entityName: string, field: string, - isFake: boolean, ): Promise { this._container.innerHTML = ""; - const objectCountAndName: [MetadataObject] = await this.getJsonObjectUtils(context, entityName, field, isFake); + const objectCountAndName: [MetadataObject] = await this.getJsonObjectUtils(context, entityName, field); ReactDOM.render(React.createElement(CardView, objectCountAndName), this._container); } @@ -61,7 +59,7 @@ export class CardViewer implements ComponentFramework.StandardControl, entityName: string, options: string) { @@ -102,13 +100,9 @@ export class CardViewer implements ComponentFramework.StandardControl, entityName: string, field: string, - isFake: boolean, ): Promise<[MetadataObject]> => { - let objectCountAndName: [MetadataObject] = [{}] as [MetadataObject]; - if (isFake) { - objectCountAndName = mockData as [MetadataObject]; - return objectCountAndName; - } + const objectCountAndName: [MetadataObject] = [{}] as [MetadataObject]; + const metadata = await context.utils.getEntityMetadata(entityName, [field]); const values: any = Object.values(metadata.Attributes.get(field).OptionSet); let fetchXmlFromView = await context.webAPI.retrieveRecord("savedquery", context.parameters.dataset.getViewId()); diff --git a/README.md b/README.md new file mode 100644 index 0000000..46a7b5d --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# Multiselect Records + +## Description + +This control has been created to select many records from an entity. +What this will do is to insert the data split by the delimiter you have selected in your control in the single text field this is attached. +This can be useful to retrieve a "list of records" from a single field and it can be used in a plugin. + +## Download + +[DOWNLOAD LATEST RELEASE](https://github.com/victorsolaya/CardViewer/releases/latest) + +## How to configure + +1. Add the control to the view that you want to show the cards. + +## Parameters + +1. Option Set Field -> Field that is going to be used for showing the different options + +## Filter + +This is filtered based on the filter criteria of the system view. + +## Example of configuration + +![Form configuration](assets/configuration.png) + +## Demo + +![Demo](assets/demo.png) + +## Issues / Questions + +If you have any questions or issues regarding this control, please, raise an issue in github or send me an email: me@victorsolaya.com \ No newline at end of file