Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

TypeScript error in CRM 2016

Posted on by 516
Hi all,
Using Type script I am able to call a method in a single JS file. But when I try to call the method from another js file it is not working
The below is my employess.ts class
import {Address} from "./Address";
module TestType{
   export  class Employee {
        public objAddress: Address = new Address();
        static Test(): void {
            alert("12");
            var obj1 = new Employee();
            obj1.objAddress.strAddressName = "TestData"
            alert(obj1.objAddress.strAddressName);
        }
    }
}
 
In which I have used address class by using import method.
The below is my address.ts file class
export class Address {
        public strAddressName: string = "";
    }
I have added the employee.js file in the form onload and call Test method in control OnChange.
It throws error as "export is undefined" and "require is undefined"
Any suggestions?

*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans