Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@hso/d365-cli
Advanced tools
Dynamics 365 Command Line Interface for TypeScript projects for Dataverse
A Command-line interface for D365 Project Development based on HSO best practices.
It will set up a namespaced project for Forms and Webresources development including some utils for Annotation, WebApi, Base64, etcetera. The project uses TypeScript and Xrm DefinitelyTyped intellisense. For entities, it can generate entity forms including methods for getting tabs, controls, attributes. For entities, it can generate models. The entity model can be used for intellisense and helps with odata. The project has a Translation util class and the translation command generates Resx file. The deployment will set/remove dependencies to webresource files. Building obfuscated code and deploying to the D365 Solution can be done in a few CLI Commands.
Invoke the tool on the command line through the hso-d365 executable. Online help is available on the command line. See wiki for detailed CLI Commands.
Since the features and thus the documentation is growing fast, this readme only contains a Getting Started and a few examples. All documentation and examples can be found in the wiki.
npm install -g @hso/d365-cli
For a more detailed installation and prerequisites see wiki for Installation.
To create a new project, go to the parent directory of your new workspace and use the following commands:
hso-d365 new my-first-project
This will ask a couple of questions to set up the project:
Initializing D365 Project my-first-project
D365 environment url (eg. https://yourproject.crm4.dynamics.com):? https://yourproject.crm4.dynamics.com
D365 Solution name:? CoreEssentials
D365 Publisher Prefix (3 chars a-z):? hso
Namespace (eg. Customer or Product name):? mfp
Installing npm packages. This may take a while...
Initializing D365 Project done
Now go to the Webresources folder, which is the root folder of the project:
cd my-first-project
cd Webresources
To add an entity to the project use following commands:
hso-d365 generate Entity MyEntity
This will ask for the Logical Name of the Entity:
Adding D365 Entity MyEntity...
What is the Entity Logical Name? myentity
Adding D365 Entity done
To add an Webresource to the project use following commands:
hso-d365 generate Webresource MyWebresource
To build changes made to Entities and Webresources to be deployed use following command:
npm run build:prod
Now the folder Webresources/dist/mfp_ contains the bundled and obfuscated files to be deployed. It's recommended to deploy in the same folder structure to D365.
Use following command to deploy
hso-d365 deploy
static async clone(executionContext: Xrm.Events.EventContext): Promise<void> {
const formContext = executionContext.getFormContext(),
id = formContext.data.entity.getId(),
quote = await QuoteService.retrieveClone(id),
quote.name = `Copy - ${quote.name}`,
validation = await QuoteService.validateRecord(quote);
if (validation.isValid) {
try {
await QuoteService.createRecord(quote);
} catch (e) {
console.log(`${e.code} - ${e.message}`);
}
}
}
const accounts = await AccountService.retrieveMultipleRecords({
select: ['name'],
expands: [{
attribute: 'primarycontactid',
select: ['fullname']
}]
}); // returns AccountModel[]
for (const account of accounts) {
// account.primarycontactid is ContractModel
console.log(`Contact fullname: ${account.primarycontactid.fullname}`);
}
const result1 = await WebApi.executeAction('WhoAmI');
const result2 = await WebApi.executeAction(
'yourAction', {value: 'x'}, 'account', 'idOfAccount');
FAQs
Dynamics 365 Command Line Interface for TypeScript projects for Dataverse
The npm package @hso/d365-cli receives a total of 51 weekly downloads. As such, @hso/d365-cli popularity was classified as not popular.
We found that @hso/d365-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.