Skip to content

Instantly share code, notes, and snippets.

@gashupl
Created September 26, 2017 07:24
Show Gist options
  • Select an option

  • Save gashupl/1c07b88c94e20fcbc6a40e058c37efbf to your computer and use it in GitHub Desktop.

Select an option

Save gashupl/1c07b88c94e20fcbc6a40e058c37efbf to your computer and use it in GitHub Desktop.
Common.ts
/// <reference path="../Xrm/Form/account/Main/Information.d.ts" />
module Foo.Dyn365.Common {
declare var Xrm;
export class Form {
constructor() {
}
getId(): string {
return Xrm.Page.data.entity.getId();
}
getValue(name) {
let attribute = Xrm.Page.getAttribute(name);
if (attribute == null) {
return null;
} else {
return attribute.getValue();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment