Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
XrmService
✓ import { XrmService } from 'boruto-xrmservice'
✗ import XrmService from 'boruto-xrmservice'
Named export, not default. Use braces.
XrmServiceModule
✓ import { XrmServiceModule } from 'boruto-xrmservice'
✗ import { XrmServiceModule } from '@angular/common'
Module class for Angular imports. Must be imported from package root.
Xrm
✓ import { Xrm } from 'boruto-xrmservice'
✗ import { Xrm } from '@types/xrm'
The library re-exports the Xrm interface for DI token usage. Not from @types/xrm directly.
IXrmOrganizationService
✓ import { IXrmOrganizationService } from 'boruto-xrmservice'
✗ interface IXrmOrganizationService { ... }
Interface for the service, also used as injection token.
Shows Angular module setup for Boruto.XrmService and a component injecting the service to create a record.
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { XrmServiceModule, XrmService } from 'boruto-xrmservice';
@NgModule({
imports: [BrowserModule, XrmServiceModule.forRoot()],
providers: [],
bootstrap: []
})
export class AppModule { }
// Component usage
import { Component, Inject } from '@angular/core';
import { XrmService, IXrmOrganizationService } from 'boruto-xrmservice';
@Component({ selector: 'app-root', template: '' })
export class AppComponent {
constructor(@Inject(XrmService) private xrmService: IXrmOrganizationService) {
this.xrmService.create('account', { name: 'Test' }).then(console.log);
}
}
Errors
Common errors & fixes
Cannot find module 'boruto-xrmservice'
Package not installed or typo in package name.
fixRun npm install boruto-xrmservice --save
Cannot read properties of undefined (reading 'create')
XrmService not properly injected; the service instance is undefined.
fixEnsure XrmServiceModule.forRoot() is imported in AppModule and the injection token is correct.
TypeError: (intermediate value).then is not a function
The create/update/delete methods return a promise; calling .then on a non-promise.
fixCheck that you are calling the method correctly. Example: this.xrmService.create('account', {} ).then(res => console.log(res)); No provider for IXrmOrganizationService
IXrmOrganizationService is an interface and cannot be used as an injection token without a provider.
fixUse XrmService as the injection token, not IXrmOrganizationService.
Audit
Dependencies
@angular/commonrequiredRequired for Angular structural directives and DI
@angular/corerequiredCore Angular functionality, NgModule, Injectable
@types/xrmrequiredType definitions for Xrm objects (window.Xrm)