diff --git a/package-lock.json b/package-lock.json index 30f10bf..842024f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "xrmtypesgen", - "version": "1.1.0-beta", + "version": "1.1.0-beta.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "xrmtypesgen", - "version": "1.1.0-beta", + "version": "1.1.0-beta.2", "license": "MIT", "dependencies": { "adal-node": "^0.2.2", diff --git a/src/renderer.ts b/src/renderer.ts index 526e2d0..537ade4 100644 --- a/src/renderer.ts +++ b/src/renderer.ts @@ -12,7 +12,18 @@ export const render = ( ): string => { const templateBuffer = readFileSync(`${__dirname}/${templateName}.hbs`); const template = compile(templateBuffer.toString()); - const getFieldName = (value: any) => (value.DataFieldName ? value.DataFieldName : value.Id); + const getFieldName = (value: FormObject.Control) => { + if (value.DataFieldName) + return value.DataFieldName; + if (value.ClassId && value.ClassId.toLowerCase() !== '06375649-c143-495e-a496-c962e5b4488e') { + return value.Id; + } + + if (value.Parameters && value.Parameters.$values.some(parameter => parameter.Name === 'UClientUniqueName')) { + return value.Parameters.$values.find(parameter => parameter.Name === 'UClientUniqueName')?.Value; + } + return "Timeline" + }; registerHelper('formtype', (value) => (value === 2 ? 'main' : 'quickcreate')); // eslint-disable-next-line no-confusing-arrow registerHelper( @@ -83,7 +94,7 @@ export const render = ( }); }); }); - controls.sort((a, b) => getFieldName(a).localeCompare(getFieldName(b))); + controls.sort((a, b) => getFieldName(a)?.localeCompare(getFieldName(b) || '') || 0); return controls; }); registerHelper('sectionCollector', (formdata: FormObject.Tab) => { @@ -106,7 +117,7 @@ export const render = ( } }); }); - cells.sort((a, b) => getFieldName(a.Control).localeCompare(getFieldName(b.Control))); + cells.sort((a, b) => getFieldName(a.Control)?.localeCompare(getFieldName(b.Control) || '') || 0); return cells; }); const formObj: FormObject.Form = data.formjson ? JSON.parse(data.formjson) : null; diff --git a/src/types.d.ts b/src/types.d.ts index 6cbed8f..97d0eef 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -113,5 +113,12 @@ namespace FormObject { DataFieldName: string; Id: string; ClassId: string; + Parameters?: { + $values: + { + Name: string, + Value: string, + }[] + }, } } diff --git a/tests/__snapshots__/renderer.test.ts.snap b/tests/__snapshots__/renderer.test.ts.snap index 11193c4..9a0f32e 100644 --- a/tests/__snapshots__/renderer.test.ts.snap +++ b/tests/__snapshots__/renderer.test.ts.snap @@ -1378,6 +1378,39 @@ declare namespace Xrm.Ext.Entities { " `; +exports[`renderer tests render tests should return valid type declaration for Early-Bound form with Timeline control 1`] = ` +"// This file was generated with XrmTypesGen +// GitHub: https://github.com/OliverFlint/XrmTypesGen + +declare namespace Xrm.Ext.Forms.albxm_MultiSwitchTest.main { + /** + * Entity/Table Name: \`albxm_MultiSwitchTest\` + * + * Form Type: \`main\` + * + * Form Name: \`Information\` + */ + interface Information + extends Xrm.EarlyBound.Form { + albxm_coloredoption: \\"albxm_ColoredOption\\"; + albxm_name: \\"albxm_Name\\"; + Timeline: Xrm.Controls.TimelineWall; + Timeline_Again: Xrm.Controls.TimelineWall; + + \\".Tabs\\": { + \\"\\": { + \\"\\": + | \\"albxm_coloredoption\\" + | \\"albxm_name\\" + | \\"Timeline\\" + | \\"Timeline_Again\\"; + }; + }; + } +} +" +`; + exports[`renderer tests render tests should return valid type declaration for Early-Bound main form 1`] = ` "// This file was generated with XrmTypesGen // GitHub: https://github.com/OliverFlint/XrmTypesGen @@ -1432,7 +1465,6 @@ declare namespace Xrm.Ext.Forms.Contact.main { managerphone: \\"ManagerPhone\\"; middlename: \\"MiddleName\\"; mobilephone: \\"MobilePhone\\"; - notescontrol: Xrm.Controls.TimelineWall; originatingleadid: \\"OriginatingLeadId\\"; ownerid: \\"OwnerId\\"; parentcustomerid: \\"ParentCustomerId\\"; @@ -1447,6 +1479,7 @@ declare namespace Xrm.Ext.Forms.Contact.main { spousesname: \\"SpousesName\\"; telephone1: \\"Telephone1\\"; telephone2: \\"Telephone2\\"; + Timeline: Xrm.Controls.TimelineWall; transactioncurrencyid: \\"TransactionCurrencyId\\"; WebResource_RecordWall: Xrm.Controls.IframeControl; @@ -1525,7 +1558,7 @@ declare namespace Xrm.Ext.Forms.Contact.main { }; \\"notes and activities\\": { activities: \\"contactactivitiesgrid\\"; - notes: \\"notescontrol\\"; + notes: \\"Timeline\\"; }; tab_recordwall: { tab_recordwall_section_1: \\"WebResource_RecordWall\\"; @@ -2417,11 +2450,11 @@ declare namespace Xrm { controlName: \\"contactactivitiesgrid\\" ): Xrm.Controls.GridControl; /** - * Gets the \`notescontrol\` control. + * Gets the \`Timeline\` control. * * @returns \`Xrm.Controls.TimelineWall\`. */ - getControl(controlName: \\"notescontrol\\"): Xrm.Controls.TimelineWall; + getControl(controlName: \\"Timeline\\"): Xrm.Controls.TimelineWall; /** * Gets the \`WebResource_RecordWall\` control. * @@ -2788,11 +2821,11 @@ declare namespace Xrm { */ get(controlName: \\"contactactivitiesgrid\\"): Xrm.Controls.GridControl; /** - * Gets the \`notescontrol\` control. + * Gets the \`Timeline\` control. * * @returns \`Xrm.Controls.TimelineWall\`. */ - get(controlName: \\"notescontrol\\"): Xrm.Controls.TimelineWall; + get(controlName: \\"Timeline\\"): Xrm.Controls.TimelineWall; /** * Gets the \`WebResource_RecordWall\` control. * @@ -3778,11 +3811,11 @@ declare namespace Xrm { }; type notesSectionControls = Xrm.Collection.ItemCollection & { /** - * Gets the \`notescontrol\` control. + * Gets the \`Timeline\` control. * * @returns \`Xrm.Controls.TimelineWall\`. */ - get(controlname: \\"notescontrol\\"): Xrm.Controls.TimelineWall; + get(controlname: \\"Timeline\\"): Xrm.Controls.TimelineWall; }; type tab_recordwall_section_1SectionControls = Xrm.Collection.ItemCollection & { /** diff --git a/tests/data/albxm_multiswitchtest.information.form.json b/tests/data/albxm_multiswitchtest.information.form.json new file mode 100644 index 0000000..c901d16 --- /dev/null +++ b/tests/data/albxm_multiswitchtest.information.form.json @@ -0,0 +1,10 @@ +{ + "@odata.etag": "W/\"3964620\"", + "description": "A form for this entity.", + "formjson": "{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Form, Microsoft.Crm.ObjectModel\",\"FormId\":\"09d381ff-16ab-43e8-8673-61ccd2f28ff5\",\"EntityLogicalName\":null,\"TabAttributes\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.TabAttributes, Microsoft.Crm.ObjectModel\",\"addedby\":null,\"filterby\":null,\"dashboardCategory\":null,\"timeframe\":null,\"primaryentitylogicalname\":null,\"entityview\":null,\"tilepresent\":false},\"Tabs\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Tab[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Tab, Microsoft.Crm.ObjectModel\",\"Columns\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Column[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Column, Microsoft.Crm.ObjectModel\",\"Sections\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Section[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Section, Microsoft.Crm.ObjectModel\",\"Rows\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell, Microsoft.Crm.ObjectModel\",\"ColSpan\":1,\"RowSpan\":1,\"AutoExpand\":false,\"IsInFirstColumnOfSection\":true,\"IsInLastColumnOfSection\":true,\"Locklevel\":0,\"UserSpacer\":false,\"IsPreviewCell\":false,\"IsStreamCell\":false,\"IsChartCell\":false,\"IsTileCell\":false,\"Control\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControl, Microsoft.Crm.ObjectModel\",\"UniqueId\":\"00000000-0000-0000-0000-000000000000\",\"DataFieldName\":\"albxm_name\",\"ClassId\":\"4273edbd-ac1d-40d3-9fb2-095c621b552d\",\"Parameters\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter[], Microsoft.Crm.ObjectModel\",\"$values\":[]},\"Disabled\":false,\"ControlLayout\":0,\"RequiredLevel\":0,\"Type\":0,\"IsUnbound\":false,\"IsRequired\":false,\"EventHandlers\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.EventHandlerDescriptor[], Microsoft.Crm.ObjectModel\",\"$values\":[]},\"relationship\":null,\"Name\":null,\"Id\":\"albxm_name\",\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":\"{393a1f3e-27b7-464a-add7-219b24f5dc99}\"},\"AvailableForPhone\":true,\"Name\":null,\"Id\":\"{393a1f3e-27b7-464a-add7-219b24f5dc99}\",\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":null}]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell, Microsoft.Crm.ObjectModel\",\"ColSpan\":1,\"RowSpan\":1,\"AutoExpand\":false,\"IsInFirstColumnOfSection\":true,\"IsInLastColumnOfSection\":true,\"Locklevel\":0,\"UserSpacer\":false,\"IsPreviewCell\":false,\"IsStreamCell\":false,\"IsChartCell\":false,\"IsTileCell\":false,\"Control\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControl, Microsoft.Crm.ObjectModel\",\"UniqueId\":\"039414a4-775e-19b2-a831-2d34b461cde7\",\"DataFieldName\":\"albxm_coloredoption\",\"ClassId\":\"f9a8a302-114e-466a-b582-6771b2ae0d92\",\"Parameters\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter[], Microsoft.Crm.ObjectModel\",\"$values\":[]},\"Disabled\":false,\"ControlLayout\":0,\"RequiredLevel\":0,\"Type\":0,\"IsUnbound\":false,\"IsRequired\":false,\"EventHandlers\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.EventHandlerDescriptor[], Microsoft.Crm.ObjectModel\",\"$values\":[]},\"relationship\":null,\"Name\":null,\"Id\":\"albxm_coloredoption\",\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":\"{a7249bd5-3e67-d012-0135-22512caaa6b2}\"},\"AvailableForPhone\":true,\"Name\":null,\"Id\":\"{a7249bd5-3e67-d012-0135-22512caaa6b2}\",\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":null}]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell, Microsoft.Crm.ObjectModel\",\"ColSpan\":1,\"RowSpan\":15,\"AutoExpand\":false,\"IsInFirstColumnOfSection\":true,\"IsInLastColumnOfSection\":true,\"Locklevel\":0,\"UserSpacer\":false,\"IsPreviewCell\":false,\"IsStreamCell\":false,\"IsChartCell\":false,\"IsTileCell\":false,\"Control\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControl, Microsoft.Crm.ObjectModel\",\"UniqueId\":\"00000000-0000-0000-0000-000000000000\",\"DataFieldName\":null,\"ClassId\":\"06375649-c143-495e-a496-c962e5b4488e\",\"Parameters\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"UClientUniqueName\",\"Value\":\"Timeline_Again\",\"TargetEntities\":null,\"StreamObjects\":null}]},\"Disabled\":false,\"ControlLayout\":0,\"RequiredLevel\":0,\"Type\":8,\"IsUnbound\":false,\"IsRequired\":false,\"EventHandlers\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.EventHandlerDescriptor[], Microsoft.Crm.ObjectModel\",\"$values\":[]},\"relationship\":null,\"Name\":null,\"Id\":\"notescontrol\",\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":\"{5f1a5a72-de6c-4ee3-936f-6f46c0cd4e8c}\"},\"AvailableForPhone\":true,\"Name\":null,\"Id\":\"{5f1a5a72-de6c-4ee3-936f-6f46c0cd4e8c}\",\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":null}]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell, Microsoft.Crm.ObjectModel\",\"ColSpan\":1,\"RowSpan\":15,\"AutoExpand\":false,\"IsInFirstColumnOfSection\":true,\"IsInLastColumnOfSection\":true,\"Locklevel\":0,\"UserSpacer\":false,\"IsPreviewCell\":false,\"IsStreamCell\":false,\"IsChartCell\":false,\"IsTileCell\":false,\"Control\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControl, Microsoft.Crm.ObjectModel\",\"UniqueId\":\"00000000-0000-0000-0000-000000000000\",\"DataFieldName\":null,\"ClassId\":\"06375649-c143-495e-a496-c962e5b4488e\",\"Parameters\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter[], Microsoft.Crm.ObjectModel\",\"$values\":[]},\"Disabled\":false,\"ControlLayout\":0,\"RequiredLevel\":0,\"Type\":8,\"IsUnbound\":false,\"IsRequired\":false,\"EventHandlers\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.EventHandlerDescriptor[], Microsoft.Crm.ObjectModel\",\"$values\":[]},\"relationship\":null,\"Name\":null,\"Id\":\"notescontrol\",\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":\"{3a8d179a-360d-45af-a83e-35429ec6c704}\"},\"AvailableForPhone\":true,\"Name\":null,\"Id\":\"{3a8d179a-360d-45af-a83e-35429ec6c704}\",\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":null}]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Row, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Height\":null,\"Cells\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Cell[], Microsoft.Crm.ObjectModel\",\"$values\":[]}}]},\"Columns\":0,\"LabelWidth\":0,\"CellLabel\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CellLabel, Microsoft.Crm.ObjectModel\",\"Width\":0,\"Alignment\":0,\"Position\":0},\"Height\":null,\"AvailableForPhone\":true,\"Name\":null,\"Id\":\"{aeb4cdeb-714b-4e9f-9198-e0a3c32670f6}\",\"Label\":null,\"ShowLabel\":false,\"Visible\":true,\"LabelId\":null}]},\"Width\":\"100%\",\"Name\":null,\"Id\":null,\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":null}]},\"EventHandlers\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.EventHandlerDescriptor[], Microsoft.Crm.ObjectModel\",\"$values\":[]},\"TabHeader\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Control[], Microsoft.Crm.ObjectModel\",\"$values\":[]},\"TabFooter\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Control[], Microsoft.Crm.ObjectModel\",\"$values\":[]},\"ContentType\":\"cardSections\",\"AvailableForPhone\":true,\"Name\":null,\"Id\":\"{edf3795f-e1d1-4100-931b-369847c90283}\",\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":null}]},\"HiddenFields\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Control[], Microsoft.Crm.ObjectModel\",\"$values\":[]},\"Header\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Header, Microsoft.Crm.ObjectModel\",\"ShowCommandBar\":true,\"ShowBody\":true,\"ShowTabNavigator\":true,\"Controls\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Control[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControl, Microsoft.Crm.ObjectModel\",\"UniqueId\":\"00000000-0000-0000-0000-000000000000\",\"DataFieldName\":null,\"ClassId\":\"00000000-0000-0000-0000-000000000000\",\"Parameters\":null,\"Disabled\":false,\"ControlLayout\":0,\"RequiredLevel\":0,\"Type\":0,\"IsUnbound\":false,\"IsRequired\":false,\"EventHandlers\":null,\"relationship\":null,\"Name\":null,\"Id\":null,\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControl, Microsoft.Crm.ObjectModel\",\"UniqueId\":\"00000000-0000-0000-0000-000000000000\",\"DataFieldName\":null,\"ClassId\":\"00000000-0000-0000-0000-000000000000\",\"Parameters\":null,\"Disabled\":false,\"ControlLayout\":0,\"RequiredLevel\":0,\"Type\":0,\"IsUnbound\":false,\"IsRequired\":false,\"EventHandlers\":null,\"relationship\":null,\"Name\":null,\"Id\":null,\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControl, Microsoft.Crm.ObjectModel\",\"UniqueId\":\"00000000-0000-0000-0000-000000000000\",\"DataFieldName\":null,\"ClassId\":\"00000000-0000-0000-0000-000000000000\",\"Parameters\":null,\"Disabled\":false,\"ControlLayout\":0,\"RequiredLevel\":0,\"Type\":0,\"IsUnbound\":false,\"IsRequired\":false,\"EventHandlers\":null,\"relationship\":null,\"Name\":null,\"Id\":null,\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.DataBoundControl, Microsoft.Crm.ObjectModel\",\"DataFieldName\":null,\"ClassId\":\"06e9f7af-1f54-4681-8eec-1e21a1ceb465\",\"Parameters\":null,\"Disabled\":false,\"ControlLayout\":0,\"RequiredLevel\":0,\"Type\":14,\"IsUnbound\":false,\"IsRequired\":false,\"EventHandlers\":null,\"relationship\":null,\"Name\":\"header_process\",\"Id\":\"header_process\",\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":null}]},\"AvailableForPhone\":true,\"Name\":null,\"Id\":null,\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":null},\"Footer\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Footer, Microsoft.Crm.ObjectModel\",\"Visible\":true,\"Controls\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Control[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControl, Microsoft.Crm.ObjectModel\",\"UniqueId\":\"00000000-0000-0000-0000-000000000000\",\"DataFieldName\":null,\"ClassId\":\"00000000-0000-0000-0000-000000000000\",\"Parameters\":null,\"Disabled\":false,\"ControlLayout\":0,\"RequiredLevel\":0,\"Type\":0,\"IsUnbound\":false,\"IsRequired\":false,\"EventHandlers\":null,\"relationship\":null,\"Name\":null,\"Id\":null,\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControl, Microsoft.Crm.ObjectModel\",\"UniqueId\":\"00000000-0000-0000-0000-000000000000\",\"DataFieldName\":null,\"ClassId\":\"00000000-0000-0000-0000-000000000000\",\"Parameters\":null,\"Disabled\":false,\"ControlLayout\":0,\"RequiredLevel\":0,\"Type\":0,\"IsUnbound\":false,\"IsRequired\":false,\"EventHandlers\":null,\"relationship\":null,\"Name\":null,\"Id\":null,\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControl, Microsoft.Crm.ObjectModel\",\"UniqueId\":\"00000000-0000-0000-0000-000000000000\",\"DataFieldName\":null,\"ClassId\":\"00000000-0000-0000-0000-000000000000\",\"Parameters\":null,\"Disabled\":false,\"ControlLayout\":0,\"RequiredLevel\":0,\"Type\":0,\"IsUnbound\":false,\"IsRequired\":false,\"EventHandlers\":null,\"relationship\":null,\"Name\":null,\"Id\":null,\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":null}]},\"AvailableForPhone\":true,\"Name\":null,\"Id\":null,\"Label\":null,\"ShowLabel\":true,\"LabelId\":null},\"InlineEditGridRow\":null,\"InlineQuickForms\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.QuickForm[], Microsoft.Crm.ObjectModel\",\"$values\":[]},\"QuickForms\":null,\"EventHandlers\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.EventHandlerDescriptor[], Microsoft.Crm.ObjectModel\",\"$values\":[]},\"LinkControlSections\":null,\"FormType\":2,\"SubGrids\":null,\"Views\":null,\"Charts\":null,\"CustomControlConfigurations\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControlConfiguration[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControlConfiguration, Microsoft.Crm.ObjectModel\",\"UniqueId\":\"039414a4-775e-19b2-a831-2d34b461cde7\",\"CustomControls\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControlItem[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControlItem, Microsoft.Crm.ObjectModel\",\"CustomControlId\":\"4aa28ab7-9c13-4f57-a73d-ad894d048b5f\",\"FormFactor\":-1,\"Name\":null,\"DisplayNameKey\":null,\"Version\":null,\"Parameters\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"datafieldname\",\"Value\":\"albxm_coloredoption\",\"TargetEntities\":null,\"StreamObjects\":null}]},\"ShouldOverrideControlVisible\":false},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControlItem, Microsoft.Crm.ObjectModel\",\"CustomControlId\":\"00000000-0000-0000-0000-000000000000\",\"FormFactor\":0,\"Name\":\"albx_AlbanianXrm.MultiSwitch\",\"DisplayNameKey\":null,\"Version\":null,\"Parameters\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"selection\",\"Value\":\"albxm_coloredoption\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"controlType\",\"Value\":\"0\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"orientation\",\"Value\":\"0\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"pillColorOn\",\"Value\":\"#AA0000\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"thumbColorOn\",\"Value\":\"#00FF00\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"pillColorHoverOn\",\"Value\":\"#FF0000\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"pillColorOff\",\"Value\":\"#001010\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"thumbColorOff\",\"Value\":\"#00AA00\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"thumbColorHoverOff\",\"Value\":\"#00FF00\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"useColorForLabel\",\"Value\":\"Yes\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"msinternal.isvisibleinmocaonly\",\"Value\":\"true\",\"TargetEntities\":null,\"StreamObjects\":null}]},\"ShouldOverrideControlVisible\":true},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControlItem, Microsoft.Crm.ObjectModel\",\"CustomControlId\":\"00000000-0000-0000-0000-000000000000\",\"FormFactor\":1,\"Name\":\"albx_AlbanianXrm.MultiSwitch\",\"DisplayNameKey\":null,\"Version\":null,\"Parameters\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"selection\",\"Value\":\"albxm_coloredoption\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"controlType\",\"Value\":\"0\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"orientation\",\"Value\":\"0\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"pillColorOn\",\"Value\":\"#AA0000\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"thumbColorOn\",\"Value\":\"#00FF00\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"pillColorHoverOn\",\"Value\":\"#FF0000\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"pillColorOff\",\"Value\":\"#001010\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"thumbColorOff\",\"Value\":\"#00AA00\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"thumbColorHoverOff\",\"Value\":\"#00FF00\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"useColorForLabel\",\"Value\":\"Yes\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"msinternal.isvisibleinmocaonly\",\"Value\":\"true\",\"TargetEntities\":null,\"StreamObjects\":null}]},\"ShouldOverrideControlVisible\":true},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.CustomControlItem, Microsoft.Crm.ObjectModel\",\"CustomControlId\":\"00000000-0000-0000-0000-000000000000\",\"FormFactor\":2,\"Name\":\"albx_AlbanianXrm.MultiSwitch\",\"DisplayNameKey\":null,\"Version\":null,\"Parameters\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"selection\",\"Value\":\"albxm_coloredoption\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"controlType\",\"Value\":\"0\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"orientation\",\"Value\":\"0\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"pillColorOn\",\"Value\":\"#AA0000\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"thumbColorOn\",\"Value\":\"#00FF00\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"pillColorHoverOn\",\"Value\":\"#FF0000\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"pillColorOff\",\"Value\":\"#001010\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"thumbColorOff\",\"Value\":\"#00AA00\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"thumbColorHoverOff\",\"Value\":\"#00FF00\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"useColorForLabel\",\"Value\":\"Yes\",\"TargetEntities\":null,\"StreamObjects\":null},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter, Microsoft.Crm.ObjectModel\",\"Name\":\"msinternal.isvisibleinmocaonly\",\"Value\":\"true\",\"TargetEntities\":null,\"StreamObjects\":null}]},\"ShouldOverrideControlVisible\":true}]},\"FormLibraries\":null,\"EventHandlers\":null,\"VersionNumber\":0,\"OverallVersionNumber\":0,\"PrimaryEntityType\":null}]},\"BusinessLogic\":null,\"FormLibraries\":{\"$type\":\"System.String[], mscorlib\",\"$values\":[]},\"ClientResources\":{\"$type\":\"System.String[], mscorlib\",\"$values\":[]},\"Navigation\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.NavPaneItems, Microsoft.Crm.ObjectModel\",\"NavBarAreas\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.NavBarAreasDescriptor, Microsoft.Crm.ObjectModel\",\"NavBarAreas\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.NavBarAreaDescriptor[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.NavBarAreaDescriptor, Microsoft.Crm.ObjectModel\",\"Titles\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Title[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Title, Microsoft.Crm.ObjectModel\",\"LCID\":1033,\"Text\":\"Common\"}]},\"Id\":\"Info\"},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.NavBarAreaDescriptor, Microsoft.Crm.ObjectModel\",\"Titles\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Title[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Title, Microsoft.Crm.ObjectModel\",\"LCID\":1033,\"Text\":\"Sales\"}]},\"Id\":\"Sales\"},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.NavBarAreaDescriptor, Microsoft.Crm.ObjectModel\",\"Titles\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Title[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Title, Microsoft.Crm.ObjectModel\",\"LCID\":1033,\"Text\":\"Service\"}]},\"Id\":\"Service\"},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.NavBarAreaDescriptor, Microsoft.Crm.ObjectModel\",\"Titles\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Title[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Title, Microsoft.Crm.ObjectModel\",\"LCID\":1033,\"Text\":\"Marketing\"}]},\"Id\":\"Marketing\"},{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.NavBarAreaDescriptor, Microsoft.Crm.ObjectModel\",\"Titles\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Title[], Microsoft.Crm.ObjectModel\",\"$values\":[{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Title, Microsoft.Crm.ObjectModel\",\"LCID\":1033,\"Text\":\"Process Sessions\"}]},\"Id\":\"ProcessCenter\"}]}},\"NavPaneIsvItems\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.NavBarIsvItemsDescriptor, Microsoft.Crm.ObjectModel\",\"NavBarIsvItems\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.NavBarDescriptor[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},\"NavBarByRelationshipItems\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.NavBarByRelationshipItemDescriptor[], Microsoft.Crm.ObjectModel\",\"$values\":[]},\"NavBarItems\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.NavBarItem[], Microsoft.Crm.ObjectModel\",\"$values\":[]}},\"ShowNavigationBar\":true,\"ShowEntityImage\":true,\"HeaderDensity\":\"HighWithControls\",\"ShowQuickFormBorder\":true,\"FormParameters\":{\"$type\":\"Microsoft.Crm.ObjectModel.FormXmlToJsonUtil.Descriptors.Parameter[], Microsoft.Crm.ObjectModel\",\"$values\":[]},\"VersionNumber\":0,\"OverallVersionNumber\":0,\"ShowInFormSelector\":true,\"Name\":null,\"Id\":\"09d381ff-16ab-43e8-8673-61ccd2f28ff5\",\"Label\":null,\"ShowLabel\":true,\"Visible\":true,\"LabelId\":null}", + "formid": "09d381ff-16ab-43e8-8673-61ccd2f28ff5", + "name": "Information", + "formactivationstate": 1, + "type": 2, + "objecttypecode": "albxm_multiswitchtest" +} \ No newline at end of file diff --git a/tests/data/albxm_multiswitchtest.metadata.json b/tests/data/albxm_multiswitchtest.metadata.json new file mode 100644 index 0000000..a867769 --- /dev/null +++ b/tests/data/albxm_multiswitchtest.metadata.json @@ -0,0 +1,313 @@ +{ + "@odata.context": "https://orgc2e04740.crm4.dynamics.com/api/data/v9.2/$metadata#EntityDefinitions(LogicalName,SchemaName,Attributes(LogicalName,SchemaName,AttributeType,AttributeTypeName))/$entity", + "LogicalName": "albxm_multiswitchtest", + "SchemaName": "albxm_MultiSwitchTest", + "MetadataId": "678d1550-5a2d-ed11-9db1-000d3a263527", + "Attributes": [ + { + "@odata.type": "#Microsoft.Dynamics.CRM.StringAttributeMetadata", + "LogicalName": "createdonbehalfbyyominame", + "SchemaName": "CreatedOnBehalfByYomiName", + "AttributeType": "String", + "MetadataId": "8846f66c-e2d9-4400-a4ef-b0751ddb24ed", + "AttributeTypeName": { + "Value": "StringType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.LookupAttributeMetadata", + "LogicalName": "modifiedonbehalfby", + "SchemaName": "ModifiedOnBehalfBy", + "AttributeType": "Lookup", + "MetadataId": "a4568c6c-939d-457c-9278-9567ceae542f", + "AttributeTypeName": { + "Value": "LookupType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.StateAttributeMetadata", + "LogicalName": "statecode", + "SchemaName": "statecode", + "AttributeType": "State", + "MetadataId": "4c113804-8c96-4dd2-bc7b-5426293ec977", + "AttributeTypeName": { + "Value": "StateType" + } + }, + { + "LogicalName": "statecodename", + "SchemaName": "statecodeName", + "AttributeType": "Virtual", + "MetadataId": "1b9736ed-d965-407f-aeb9-19e37674a8bc", + "AttributeTypeName": { + "Value": "VirtualType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.LookupAttributeMetadata", + "LogicalName": "createdonbehalfby", + "SchemaName": "CreatedOnBehalfBy", + "AttributeType": "Lookup", + "MetadataId": "72436b22-9559-4f79-a8c4-ed1bfc836a20", + "AttributeTypeName": { + "Value": "LookupType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.MultiSelectPicklistAttributeMetadata", + "LogicalName": "albxm_coloredoption", + "SchemaName": "albxm_ColoredOption", + "AttributeType": "Virtual", + "MetadataId": "009f8948-1f5c-ed11-9562-6045bd905203", + "AttributeTypeName": { + "Value": "MultiSelectPicklistType" + } + }, + { + "LogicalName": "albxm_multiswitchtestid", + "SchemaName": "albxm_MultiSwitchTestId", + "AttributeType": "Uniqueidentifier", + "MetadataId": "7129f4e9-51df-4d91-a64d-42d2bb9b479d", + "AttributeTypeName": { + "Value": "UniqueidentifierType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.IntegerAttributeMetadata", + "LogicalName": "importsequencenumber", + "SchemaName": "ImportSequenceNumber", + "AttributeType": "Integer", + "MetadataId": "1a8de8b1-17a5-43f7-a066-3226b48b7fdb", + "AttributeTypeName": { + "Value": "IntegerType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.StringAttributeMetadata", + "LogicalName": "organizationidname", + "SchemaName": "OrganizationIdName", + "AttributeType": "String", + "MetadataId": "2adcd8bc-9319-4279-8344-aec3c3346b57", + "AttributeTypeName": { + "Value": "StringType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.StringAttributeMetadata", + "LogicalName": "modifiedbyyominame", + "SchemaName": "ModifiedByYomiName", + "AttributeType": "String", + "MetadataId": "b1b38b27-797d-4b85-b726-85b45bd9814f", + "AttributeTypeName": { + "Value": "StringType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.IntegerAttributeMetadata", + "LogicalName": "utcconversiontimezonecode", + "SchemaName": "UTCConversionTimeZoneCode", + "AttributeType": "Integer", + "MetadataId": "13ce2408-28a7-48eb-acb6-f4550f9e3669", + "AttributeTypeName": { + "Value": "IntegerType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.StringAttributeMetadata", + "LogicalName": "createdbyyominame", + "SchemaName": "CreatedByYomiName", + "AttributeType": "String", + "MetadataId": "7539d0e2-1a19-4e60-a002-eff00b7108f7", + "AttributeTypeName": { + "Value": "StringType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.StringAttributeMetadata", + "LogicalName": "modifiedbyname", + "SchemaName": "ModifiedByName", + "AttributeType": "String", + "MetadataId": "eae142e4-6356-49ec-ae0d-ebc524f84a32", + "AttributeTypeName": { + "Value": "StringType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.BigIntAttributeMetadata", + "LogicalName": "versionnumber", + "SchemaName": "VersionNumber", + "AttributeType": "BigInt", + "MetadataId": "4dfd3f88-0ed9-436a-aca4-6d877c0879ef", + "AttributeTypeName": { + "Value": "BigIntType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.LookupAttributeMetadata", + "LogicalName": "modifiedby", + "SchemaName": "ModifiedBy", + "AttributeType": "Lookup", + "MetadataId": "80fc4026-b28f-43c1-8880-80a094f6bdcd", + "AttributeTypeName": { + "Value": "LookupType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.LookupAttributeMetadata", + "LogicalName": "createdby", + "SchemaName": "CreatedBy", + "AttributeType": "Lookup", + "MetadataId": "1a48da15-4dbd-45fe-a715-16686ffbcb38", + "AttributeTypeName": { + "Value": "LookupType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.IntegerAttributeMetadata", + "LogicalName": "timezoneruleversionnumber", + "SchemaName": "TimeZoneRuleVersionNumber", + "AttributeType": "Integer", + "MetadataId": "53407800-ab8a-4a90-a810-15facd80b832", + "AttributeTypeName": { + "Value": "IntegerType" + } + }, + { + "LogicalName": "statuscodename", + "SchemaName": "statuscodeName", + "AttributeType": "Virtual", + "MetadataId": "e1db524f-2ec7-4f06-ad05-c4ae23ee5f4c", + "AttributeTypeName": { + "Value": "VirtualType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.MultiSelectPicklistAttributeMetadata", + "LogicalName": "albxm_manyoptions", + "SchemaName": "albxm_ManyOptions", + "AttributeType": "Virtual", + "MetadataId": "bcacb808-1f5c-ed11-9562-6045bd905203", + "AttributeTypeName": { + "Value": "MultiSelectPicklistType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.DateTimeAttributeMetadata", + "LogicalName": "modifiedon", + "SchemaName": "ModifiedOn", + "AttributeType": "DateTime", + "MetadataId": "b7673339-adbe-4b87-9c18-efc5f3f4ab9c", + "AttributeTypeName": { + "Value": "DateTimeType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.StringAttributeMetadata", + "LogicalName": "albxm_name", + "SchemaName": "albxm_Name", + "AttributeType": "String", + "MetadataId": "688d1550-5a2d-ed11-9db1-000d3a263527", + "AttributeTypeName": { + "Value": "StringType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.StringAttributeMetadata", + "LogicalName": "modifiedonbehalfbyyominame", + "SchemaName": "ModifiedOnBehalfByYomiName", + "AttributeType": "String", + "MetadataId": "fb653959-b430-47e3-9f7b-abb5ce9188ef", + "AttributeTypeName": { + "Value": "StringType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.StatusAttributeMetadata", + "LogicalName": "statuscode", + "SchemaName": "statuscode", + "AttributeType": "Status", + "MetadataId": "81e1c5e6-f246-42bc-8605-f63eb0a3d2ec", + "AttributeTypeName": { + "Value": "StatusType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.StringAttributeMetadata", + "LogicalName": "createdbyname", + "SchemaName": "CreatedByName", + "AttributeType": "String", + "MetadataId": "09b5030c-5446-45ea-9a89-96d1ff14cc33", + "AttributeTypeName": { + "Value": "StringType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.DateTimeAttributeMetadata", + "LogicalName": "createdon", + "SchemaName": "CreatedOn", + "AttributeType": "DateTime", + "MetadataId": "3d2d4450-37c1-4c55-8228-bcb274676a05", + "AttributeTypeName": { + "Value": "DateTimeType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.LookupAttributeMetadata", + "LogicalName": "organizationid", + "SchemaName": "OrganizationId", + "AttributeType": "Lookup", + "MetadataId": "02d7a88f-02ed-41a6-aa42-9a6afc678272", + "AttributeTypeName": { + "Value": "LookupType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.StringAttributeMetadata", + "LogicalName": "createdonbehalfbyname", + "SchemaName": "CreatedOnBehalfByName", + "AttributeType": "String", + "MetadataId": "c0f017f4-3332-4f35-be33-d8f2c9b82a19", + "AttributeTypeName": { + "Value": "StringType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.StringAttributeMetadata", + "LogicalName": "modifiedonbehalfbyname", + "SchemaName": "ModifiedOnBehalfByName", + "AttributeType": "String", + "MetadataId": "22c46095-d9d7-4e55-bc49-de596bb0ec83", + "AttributeTypeName": { + "Value": "StringType" + } + }, + { + "LogicalName": "albxm_coloredoptionname", + "SchemaName": "albxm_coloredoptionName", + "AttributeType": "Virtual", + "MetadataId": "6709dd07-cbbd-4e6c-9795-9e7caac6988c", + "AttributeTypeName": { + "Value": "VirtualType" + } + }, + { + "@odata.type": "#Microsoft.Dynamics.CRM.DateTimeAttributeMetadata", + "LogicalName": "overriddencreatedon", + "SchemaName": "OverriddenCreatedOn", + "AttributeType": "DateTime", + "MetadataId": "21528935-5f51-4051-b26c-b333a3993a57", + "AttributeTypeName": { + "Value": "DateTimeType" + } + }, + { + "LogicalName": "albxm_manyoptionsname", + "SchemaName": "albxm_manyoptionsName", + "AttributeType": "Virtual", + "MetadataId": "89e5609c-7073-46d5-8e84-e91fed00b9e1", + "AttributeTypeName": { + "Value": "VirtualType" + } + } + ] +} \ No newline at end of file diff --git a/tests/choices.metadata.json b/tests/data/choices.metadata.json similarity index 100% rename from tests/choices.metadata.json rename to tests/data/choices.metadata.json diff --git a/tests/contact.choices.metadata.json b/tests/data/contact.choices.metadata.json similarity index 100% rename from tests/contact.choices.metadata.json rename to tests/data/contact.choices.metadata.json diff --git a/tests/contact.information.form.json b/tests/data/contact.information.form.json similarity index 100% rename from tests/contact.information.form.json rename to tests/data/contact.information.form.json diff --git a/tests/contact.metadata.json b/tests/data/contact.metadata.json similarity index 100% rename from tests/contact.metadata.json rename to tests/data/contact.metadata.json diff --git a/tests/contact.quickcreate.form.json b/tests/data/contact.quickcreate.form.json similarity index 100% rename from tests/contact.quickcreate.form.json rename to tests/data/contact.quickcreate.form.json diff --git a/tests/renderer-optionSet.test.ts b/tests/renderer-optionSet.test.ts index 1402621..b209531 100644 --- a/tests/renderer-optionSet.test.ts +++ b/tests/renderer-optionSet.test.ts @@ -8,7 +8,7 @@ describe('renderer-optionSet tests', () => { describe('renderOptionSet test', () => { test('Should return valid type declaration for choices', async () => { - const meta = (await import('./choices.metadata.json')).default as OptionSet[]; + const meta = (await import('./data/choices.metadata.json')).default as OptionSet[]; const result = renderOptionSet(meta); expect(result).toBeTruthy(); expect(result).toContain('const enum ani2001__choicestes'); diff --git a/tests/renderer.test.ts b/tests/renderer.test.ts index 97ca1fe..08f5b5b 100644 --- a/tests/renderer.test.ts +++ b/tests/renderer.test.ts @@ -8,8 +8,8 @@ describe('renderer tests', () => { describe('render tests', () => { test('should return valid type declaration for main form', async () => { - const data = await import('./contact.information.form.json'); - const meta = JSON.parse(JSON.stringify(await import('./contact.metadata.json'))); + const data = await import('./data/contact.information.form.json'); + const meta = JSON.parse(JSON.stringify(await import('./data/contact.metadata.json'))); const result = render(data, meta, 'template'); expect(result).toBeTruthy(); expect(result).toContain('namespace Ext.Forms.contact.main.Information'); @@ -17,8 +17,8 @@ describe('renderer tests', () => { }); test('should return valid type declaration for quickcreate form', async () => { - const data = await import('./contact.quickcreate.form.json'); - const meta = JSON.parse(JSON.stringify(await import('./contact.metadata.json'))); + const data = await import('./data/contact.quickcreate.form.json'); + const meta = JSON.parse(JSON.stringify(await import('./data/contact.metadata.json'))); const result = render(data, meta, 'template'); expect(result).toBeTruthy(); expect(result).toContain('namespace Ext.Forms.contact.quickcreate.ContactQuickCreate'); @@ -26,7 +26,7 @@ describe('renderer tests', () => { }); test('should return valid type declaration for Early-Bound Entity', async () => { - const meta = JSON.parse(JSON.stringify(await import('./contact.metadata.json'))); + const meta = JSON.parse(JSON.stringify(await import('./data/contact.metadata.json'))); const result = render(meta, meta, 'template-earlybound-entity'); expect(result).toBeTruthy(); expect(result).toContain('interface Contact extends Xrm.EarlyBound.Entity {'); @@ -35,8 +35,8 @@ describe('renderer tests', () => { }); test('should return valid type declaration for Early-Bound Entity', async () => { - const meta = JSON.parse(JSON.stringify(await import('./contact.metadata.json'))); - const localChoices = (await import('./contact.choices.metadata.json')) + const meta = JSON.parse(JSON.stringify(await import('./data/contact.metadata.json'))); + const localChoices = (await import('./data/contact.choices.metadata.json')) .default as LocalOptionSet[]; const result = render(meta, meta, 'template-earlybound-entity', localChoices); expect(result).toBeTruthy(); @@ -47,8 +47,8 @@ describe('renderer tests', () => { }); test('should return valid type declaration for Early-Bound main form', async () => { - const data = await import('./contact.information.form.json'); - const meta = JSON.parse(JSON.stringify(await import('./contact.metadata.json'))); + const data = await import('./data/contact.information.form.json'); + const meta = JSON.parse(JSON.stringify(await import('./data/contact.metadata.json'))); const result = render(data, meta, 'template-earlybound-form'); expect(result).toBeTruthy(); expect(result).toContain('namespace Xrm.Ext.Forms.Contact.main {'); @@ -59,13 +59,24 @@ describe('renderer tests', () => { }); test('should return valid type declaration for Early-Bound quickcreate form', async () => { - const data = await import('./contact.quickcreate.form.json'); - const meta = JSON.parse(JSON.stringify(await import('./contact.metadata.json'))); + const data = await import('./data/contact.quickcreate.form.json'); + const meta = JSON.parse(JSON.stringify(await import('./data/contact.metadata.json'))); const result = render(data, meta, 'template-earlybound-form'); expect(result).toBeTruthy(); expect(result).toContain('namespace Xrm.Ext.Forms.Contact.quickcreate {'); expect(result).toContain('extends Xrm.EarlyBound.Form {'); expect(result).toMatchSnapshot(); }); + + test('should return valid type declaration for Early-Bound form with Timeline control', async () => { + const data = await import('./data/albxm_multiswitchtest.information.form.json'); + const meta = JSON.parse(JSON.stringify(await import('./data/albxm_multiswitchtest.metadata.json'))); + const result = render(data, meta, 'template-earlybound-form'); + expect(result).toBeTruthy(); + expect(result).toContain('namespace Xrm.Ext.Forms.albxm_MultiSwitchTest.main {'); + expect(result).toContain('extends Xrm.EarlyBound.Form {'); + expect(result).toContain('Timeline_Again: Xrm.Controls.TimelineWall;'); + expect(result).toMatchSnapshot(); + }); }); });