Skip to content

Commit

Permalink
Merge branch 'release/5.4.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
nsteenbeek committed Aug 24, 2021
2 parents 721e571 + e7a2de6 commit e44d364
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bin/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hso/d365-cli",
"version": "5.4.1",
"version": "5.4.2",
"author": "HSO Innovation <[email protected]> (http://www.hso.com)",
"description": "HSO D365 Command Line Interface",
"repository": {
Expand Down
8 changes: 4 additions & 4 deletions src/generator/ControlFormContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class ControlFormContext {
for (const tab of tabs) {
const tabName = tab.Name;
if (tabName) {
const pascalTabName = ControlFormContext.capitalize(tabName.replace(/ /g, ''));
const pascalTabName = ControlFormContext.capitalize(tabName.replace(/\W/g, ''));
const methodName = ` static get${pascalTabName}Tab(formContext: FormContext): Xrm.Controls.Tab {`;
const returnString = `return formContext.ui.tabs.get('${tabName}');`;
tabsControlsString += `${methodName}\n ${returnString}\n }\n`;
Expand All @@ -86,7 +86,7 @@ export class ControlFormContext {
for (const section of sections) {
const {Name: sectionName} = section;
if (sectionName) {
const pascalSectionName = ControlFormContext.capitalize(sectionName.replace(/ /g, ''));
const pascalSectionName = ControlFormContext.capitalize(sectionName.replace(/\W/g, ''));
const methodName = ` static get${pascalSectionName}Section(formContext: FormContext): Xrm.Controls.Section {`;
const returnString = `return formContext.ui.tabs.get('${tab.Name}').sections.get('${sectionName}');`;
sectionsControlsString += `${methodName}\n ${returnString}\n }\n`;
Expand Down Expand Up @@ -127,12 +127,12 @@ export class ControlFormContext {

private async getXrmControlType(attributeMetadata: AttributeMetadata, type: number, id: string): Promise<string> {
if (attributeMetadata) {
const {AttributeType: attributeType} = attributeMetadata;
const {AttributeType: attributeType, AttributeTypeName: attributeTypeName} = attributeMetadata;
if (['String', 'Memo', 'Customer', 'Owner', 'Uniqueidentifier'].includes(attributeType)) {
return 'Xrm.Controls.StringControl';
} else if (['DateTime'].includes(attributeType)) {
return 'Xrm.Controls.DateControl';
} else if (['Boolean', 'Picklist'].includes(attributeType)) {
} else if (['Boolean', 'Picklist'].includes(attributeType) || attributeTypeName.Value === 'MultiSelectPicklistType') {
return 'Xrm.Controls.OptionSetControl';
} else if (['Lookup'].includes(attributeType)) {
return `Xrm.Controls.LookupControl`;
Expand Down
2 changes: 1 addition & 1 deletion src/generator/Enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class Enum {
for (const savedQuery of savedQueries) {
if (savedQuery && savedQuery.returnedtypecode === this.entityLogicalName) {
const {name, savedqueryid} = savedQuery;
savedQueriesString += ` ${Enum.capitalize(name.replace(/ /g, ''))}: {\n`;
savedQueriesString += ` ${Enum.capitalize(name.replace(/\W/g, ''))}: {\n`;
savedQueriesString += ` name: '${name}',\n`;
savedQueriesString += ` savedqueryid: '${savedqueryid}',\n`;
savedQueriesString += ` },\n`;
Expand Down

0 comments on commit e44d364

Please sign in to comment.