Dynamics CRM: using Xrm.Page library in Eclipse - javascript

I'm using Eclipse as JavaScript IDE.
I would like to setup Xrm.Page library in this environment (for code completion and assistance).
I couldn't find any separate library files and any tools for that, just for Visual Studio.
Is there a solution for using it in Eclipse?

Install a free copy of Visual Studio Express.
Install the VS extension from \sdk\templates\xrm.pagescriptprojecttemplate
Create a VS solution from the XrmPageScript template.
From the new solution copy of the file \Scripts\XrmPageTemplate.js
Now you can bring the XrmPageTemplate.js file into Eclipse and develop with code-completion, etc.
UPDATED DEC 02 2013
After looking at your comments I did some further investigation. Eclipse, unlike Visual Studio, does not support code completion from JavaScript source in a reliable manner. In most cases it requires a custom plugin be created to support auto completion.
Quoting from Add External JS Libraries to Eclipse JSDT-driven Projects:
Resources which are added to the Build Path can theoretically be made
available for Content Assist. That's an important distinction because
ensuring that the file is scanned does not guarantee that it will be
correctly converted into a usable object model. That's because, in
order for some JDT-based functionality to work correctly, class type
information must be inferred in many cases. Eclipse examines the
JavaScript Abstract Syntax Tree (AST) in order to generate "virtual"
class information. And while the unique conventions of the various
JavaScript Toolkits such as Dodo, jQuery, and Prototype can be handled
to some extent, at this point it's still provisional.
Some of the makers of popular JS libraries have taken a proactive role
in exposing their object model to Eclipse via a plugin.
Since the only supported development environment for Dynamics CRM is Visual Studio is not likely to see a custom plugin be released to support Xrm.Page.

Related

No Javascript support in Visual Studio 2017 for some project types

When I create a new ASP.NET Core Web Application in VS 2017, I get great Javascript support, e.g. Intellisense and formatting. On the top of the file are three dropdowns indicating the scope of where the cursor is in the project.
When I open a Javascript file in one of my older projects, e.g. when I open a local website directly, I get none of this Javascript support. The three dropdowns are empty and the only thing I really get is code coloring. I am opening the file using the same VS default Javascript editor.
Any reasons why the Javascript support would only work in some project types?
The problem was not about the project type, but instead that I used
/// <reference path = "path-to-scriptfile" />
statements in some javascript files. I think, VS 2017 does not support those statements anymore and using them ruined my JS support, which somehow even infected other files in the project that did not have such references.

Stop globals.d.ts triggering Visual Studio TypeScript services

I'm working on a legacy code base with Visual Studio 2015. There is a lot of Javascript code, and again for legacy reasons I can't just add Typescript.
Any new Javascript that is written is done in VS Code and in order to improve the quality of the Javascript I've been using the TS language services native to VS Code. This involves the use of // #ts-check and globals.d.ts so that I can remove warnings about jQuery's $ not being found, among other things.
This works fine but now every time Visual Studio 2015 finds the new globals.d.ts file it's triggering a bunch of Typescript features and adding Typescript related properties to the actual .csproj
This is not a desirable feature in this case; the code is legacy and using a legacy build system, adding new language features in the csproj is a big no-no unfortunately.
Is there a way I can have the file existing while also not causing Visual Studio 2015 to try use it? The file exists solely for VS Code's sake.
You might be able to play around with a tsconfig.json file to stop the TypeScript tab being active in Visual Studio, although it will still be looking at the TypeScript in this case.
If you want to get serious with disabling the compiler in your project, there is a documented feature to block the TypeScript compiler.
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
This would require a small change to the project file, as this needs to be placed in there, inside a <PropertyGroup>.

Is it possible to debug JavaScript code in Visual Studio without running a browser?

Visual Studio, at least in v2012, is supposed to have first-class support for JavaScript. However, I haven't found any "JavaScript project type", JS is not even listed as a top-level language in the File > New Project dialog etc.
JavaScript is, or at least is starting to be, much more than just a scripting language for web apps so I'm wondering if there is a way / plugin / extension for Visual Studio that would allow me just type in some JavaScript and execute it as a language construct (e.g., on a node console), not as part of some ASP.NET web application.
VS2012 does have support for JavaScript, but not in a "pure JS project" sense.
If you're running VS2012 RC on Win8 Release Preview, you should see project types for Windows 8 Metro style applications implemented with JavaScript. These types of projects are not available to create on Win7 and below (because they only run on Win8).
If you're working with JS inside web application projects, ASP.NET projects, etc. you'll see all the new rich features for JavaScript editing and debugging.

programming in javascript with Visual Studio (2010)?

Whether you are forced to code javascript in Visual Studio 2010, or insist on using Visual Studio 2010 instead of another IDE, I'm wondering what anyone has done to improve the javascript development experience in VS2010.
I'm asking since javascript support is lacking in Visual Studio 2010. You don't get the the kind of support you get as if you were developing Silverlight apps in C# and XAML. For example, the intellisense doesn't support javascript 1.8.5 (or even 1.6 functions i.e. JSON.Parse), it's difficult to navigate to function or object definitions (no Go To Definition), no Object Browser, Call Hierarchy, and the list can go on.
What have you done to compensate for the VS2010 features that don't exist for javascript? Also, what would be a good feature request to support javascript development; anything that VS2010 should add as an extension or a future release? Also, are there any suggestions to manage the .js code for large projects?
A few things that have helped me so far are the JScript Editor Extensions, and the Web Standards Update. Also, when working in .js files I rely on bookmarks to get back to key places, since the functions of the file aren't visible (as the would be in C#). My feature request would be to add intellisense support by javascript version, similar to how you can target .NET 2.0, 3.5, or 4.0.
There are a number of VS extensions to assist with javascript:
Visual Studio Javascript extensions feature comparison
JSEnhancements is awesome, and does what you really want: adds regions and code block collapsing.
Also see this extension: http://code.google.com/p/js-addin/
which parses your script into an object tree that can be used for navigation.
I have also used the free version of this editor: http://www.yaldex.com/JSFactory_Pro.htm
I can't recommend it, unfortunately, because it suffers from a couple critical problems (awkward UI, freaky intellisense, and not entirely stable). Which is too bad because it's a very thoughtfully designed piece of software by and large, it just fails where the rubber meets the road.
1) Install Resharper, helps a lot when building javascript heavy web apps.
2) Get FireBug for debugging.
3) Also, the JQuery.vsdocs files are sometimes helpful!
While I use vim and Notepad++ to cut code, I feel your pain, or did until I started using Firebug to debug JavaScript. While it many not be exactly fitting for your situation it's invaluable to me in developing Web based apps:
http://getfirebug.com/

Is Javascript only available for web browsers?

I would like to know about Javascript. Is Javascript available only for web browsers? Because I used some Javascript code for Firefox Plugin development and Thunderbird.
Help me to find out more about this: where can I use JavaScript other than web browsers, and how?
There's node.js which includes a full webserver and runs on Google's V8
No! Have a look at Google's V8
Google Javascript. Click first link (Wikipedia). Click "uses outside webpages".
http://en.wikipedia.org/wiki/JavaScript#Uses_outside_web_pages
There are a number of server-side (or otherwise non-browser) implementations of Javascript, including Node.js, which currently has a lot of momentum behind it, as well as the now-defunct Jaxer, which provided a server-side DOM implementation based on Mozilla Gecko. There are also efforts to bring DOM type functionality to Node.js, primarily from Yahoo.
With Rhino, you can embed Javascript in Java applications.
No, there are definitely other implementations. For instance, JScript.Net is included with the .NET framework.
MS-Windows can execute .js files (from the command prompt).
Since you do not have the browser context, you cannot use any calls to the browser (alert, for example, does not work).
Look for "Windows Scripting Host".
WSH supports scripts written in
Microsoft Visual Basic Scripting
Edition (VBScript) or JavaScript.
There are several implementations of stand-alone Javascript
JSLibs (http://code.google.com/p/jslibs/) is general purpose
jsdb (http://www.jsdb.org/) is more database oriented
Many text editors (including the one I use, ActiveState's Komodo Edit) expose their APIs and let you write macros in Javascript.
Using Adobe AIR you can write almost platform-independent Desktop Applications using JavaScript
PDF files can also contain JavaScript code. See first entry in google on this subject and also Adobe JavaScript virus.
Javascript can be easily embedded in applications written in other programming languages.
For Java there is as already mentioned Rhino, for C++ you can use for example Flusspferd. Here are some tutorials/examples.
Qt has the QtScript module. From Qt 4.7 it uses JavaScriptCore (the Webkit JavaScript engine).
In short, No.
Actually, Javascript and other Web technologies are used these days to create native mobile and desktop applications. (see Titanium Appcelerator and PhoneGap)
If you are familiar with the KDE project you can craft Plasma widgets using JavaScript, see Creating plasmoids with JavaScript
In Qt framework there is a QtScript module for JavaScript (ECMAScript) application scripting to provide much of the application’s functionality.
Also the new technology that is soon to be released in Qt 4.7 is Qt Quick, aka the Qt UI Creation Kit, which allows application developers to declaratively define their user interfaces in QML, for more information go here and an example here
QML is an extension to JavaScript,
that provides a mechanism to
declaratively build an object tree of
QML elements. QML improves the
integration between JavaScript and
Qt's existing QObject based type
system, adds support for automatic
property bindings and provides network
transparency at the language level.
And let's not forget Javascript is used as an embedded scripting language in various applications OpenOffice.org, Google Desktop Widgets, and many others, see Wikipedia's article here
On the server-side Javascript enables back-end access to databases, file systems, etc (see Node.js, Google V8, SpiderMonkey and others here)
Some document databases, such as CouchDB and MongoDB, use JavaScript to interact with the database.

Categories