Skip to content

Releases: hso-nn/d365-cli

Tab and Section names may have spaces

28 Jul 15:03
Compare
Choose a tag to compare

Tab and Section names may have spaces. The control method generation now removes the spaces to generate valid method names.

Generate Entity --skipForms

27 Jul 13:39
Compare
Choose a tag to compare

CLI Command generate Entity supports flag --skipForms. This will skip generating form folders and files and the Entity.formContext.ts.

Generate Model support

27 Jul 12:35
Compare
Choose a tag to compare

The generate Model command was deprecated for a short time, but now introduced again to only generate a model file for a specific entity. This can be handy when models refer to other models.

Form generation

16 Jul 13:29
Compare
Choose a tag to compare

Breaking changes
You need to update your project: hso-d365 update
After updating your project will be backward-compatible, but we recommend to update by following steps:

  1. Regenerate all your entities
  2. Move content from Entity/Entity.ts and Entity/Entity.form.ts to correct form subfolder equivalents
  3. Remove Entity/Entity.ts and Entity/Entity.form.ts files
  4. Remove Entity entry in webpack.config.ts
  5. Turn off unused forms in Entity/build.json, which will prevent them being deployed
  6. Deploy your code
  7. In your forms replace Entity.ts by new form equivalent
  8. In your solution deprecate/remove Entity.ts files

setFormCustomizable

15 Feb 11:20
Compare
Choose a tag to compare

SetFormCustomizable moved from project tools folder to cli

Generate Entity checks entityLogicalName

15 Feb 10:43
Compare
Choose a tag to compare

Feature: When generating an Entity, the cli will check for valid entityLogicalName
Bugfix: Resx was invoked on every command

Translation extraction

12 Feb 13:18
Compare
Choose a tag to compare

Extracting translations into resx files failed when using double quotes:

console.log(Translations.translate("test"));

Please update the project:

npm install -g @hso/d365-cli@latest
hso-d365 update

Bugfixes

10 Feb 10:12
Compare
Choose a tag to compare

Move xml2js from devDependencies to dependencies

Update command will remove TranslationI18n.ts and i18next-scanner.config.js files

CopyWebpackPlugin uses noErrorOnMissing

Linting fix in src/WebApi/Service.ts

Attributes generation for names and methods

10 Feb 10:06
Compare
Choose a tag to compare

In short the 4.x version will prevent typo's in project code by generating attribute enum and methods. Below more explanation.

Generation

Attribute names and getters generated

In current projects code like below may have three possible problems:

  1. A typo in attribute name 'industrycoode' will not result in a build failure
  2. Wrong atrribute type (OptionSetAttribute) will not result in a build failure
  3. A name change on D365 side will not result in a build failure
const formContext = executionContext.getFormContext();
const industryAttribute: Xrm.Attributes.OptionSetAttribute = formContext.getAttribute('industrycode');
const industryControl = formContext.getControl('industrycode');

Version 4.x will solve those three problems
First for creating or updating an Entity use the generate command:

hso-d365 generate Entity Account

This will generate methods like getIndustryCodeAttribute and enum AccountAttributeNames.
Then have code like below

const formContext = executionContext.getFormContext();
const industryAttribute = AccountForm.getIndustryCodeAttribute(formContext);
const industryControl = formContext.getControl(AccountAttributeNames.IndustryCode);

Breaking changes

Entity.enum.ts using SchemaName instead of LogicalName

For more readable code the Entity.enum.ts uses SchemaName instead of LogicalName.
IndustryCode.EatingandDrinkingPlaces is more readable as Industrycode.eatinganddrinkingplaces.
This may break the build, but can be fixed easy.

Entity.form.ts extend Entity.formContext.ts

After running the update command:

hso-d365 update

Entity.form.ts files will extend EntityFormContext. That will break the build and has to be fixed by running:

hso-d365 generate Entity ...

hso-d365 generate Model deprecated

The CLI command 'hso-d365 generate Model ...' is deprecated. The command 'hso-d365 generate Entity ...' became an 'upsert'.

Node 15 support

05 Feb 14:57
Compare
Choose a tag to compare

Node has been giving a warning for peer dependencies for a long time. Node 15 will fail on npm packages having peer dependencies, which are not installed. For this we had to remove and replace some packages, which are archived or not maintained at the moment. This makes the cli up-to-date and future proof.

Breaking changes

I18next

I18next is not supported anymore. Translations will be in the Dynamics CE recommended way: resx files.
If you need to migrate on this point, please follow migration steps below and run following command:

hso-d365 extractTranslations

For more info: extractTranslations

dlf-core package.json

This was too HSO specific code and logic. After update the programmer should check the package.json diff and reinstall dlf-core.

Fixes

Coverage fixed

Code coverage needed a node 15 compatible plugin and it was broken when cli introduced webpack 5.

Migration steps

  1. Update to version 2.4.2 and update
npm install -g @hso/d365-cli@2.4.2
hso-d365 update
  1. Update to version >2.4.2
npm install -g @hso/d365-cli@latest
hso-d365 update