@albanian-xrm/early-bound
v9.0.8
Published
Early Bound Type Augmentation for @types/xrm
Downloads
38
Readme
AlbanianXrm Early-Bound
Early Bound Type Augmentation for @types/xrm@9
First you install the package using one of the following commands:
yarn add -D @albanian-xrm/early-bound@9
or
npm install --save-dev @albanian-xrm/early-bound@9
The simplest way to add the typing augmentation is to use a triple-slash directive. For example you can create a global.d.ts in your src folder which contains the following:
/* src/global.d.ts */
/// <reference path="../node_modules/@albanian-xrm/early-bound/index.d.ts" />
The you just define your Early-Bound Model. For example Account.d.ts
can be described as follows:
declare namespace Models {
interface Account {
CreditOnHold: Xrm.Attributes.BooleanAttribute;
CustomerTypeCode: Xrm.Attributes.OptionSetAttribute;
ModifiedBy: Xrm.Attributes.LookupAttribute;
ModifiedOn: Xrm.Attributes.DateAttribute;
Name: Xrm.Attributes.StringAttribute;
NumberOfEmployees: Xrm.Attributes.NumberAttribute;
}
namespace Account.Forms {
interface Account extends Xrm.EarlyBound.Form<"Account"> {
name: "Name";
header_ModifiedBy: "ModifiedBy";
ModifiedBy: "ModifiedBy";
modifiedon: "ModifiedOn";
}
}
}
declare namespace Xrm.EarlyBound {
interface Entities {
Account: Models.Account;
}
}