Where is the actual JavaScript stored for custom events in Dynamics CRM 4.0? - dynamics-crm-4

We're running Microsoft Dynamics CRM 4.0, and setting up custom JavaScript event handlers on several of our forms.
I'd like this JavaScript code to be kept under revision control, but I'm not aware of any way of deploying changes to these scripts, other than manually editing (or copy/pasting) the code in the Dynamics CRM entity customisation forms - which means it would be all too easy for someone to make changes to the running system and 'forget' to copy/paste their changes into the revision-controlled version.
I'm wondering if we can use something like a trigger or a FileSystemWatcher component to catch changes to these files and make sure they're stored in revision control - but I have no idea where to find the actual raw scripts. Are they stored somewhere in the MSCRM_CONFIG or MyCompany_MSCRM databases? Or on disk somewhere on the CRM server itself?
Thanks!

It's basically included in the FormXML which is the definition of all forms in your environment. It is stored as part of the organizationui.
See also http://social.microsoft.com/Forums/en-US/aaa6f404-81eb-467d-b9bb-3d29108ec92b/where-does-crm-40-javascript-code-get-stored-in-database

The JavaScript is stored inside the database, I can't find the exact table for CRM 4.0 (here an article about CRM 2011 location just for your information http://kellyhoang.blogspot.com/2012/01/crm-2011-customization-decript-default.html)
There is also a tool for extracting the JavaScript from a CRM 4.0 instance, you can find it here:
http://blogs.infinite-x.net/2011/09/30/export-javascript-crm-4-0-updated/
(you can decompile it to look how it works, or ask the author directly)

Related

Sharepoint and Database interaction, what should I do?

I've developped a MySQL database containing informations about different documents and products. Now I have to create a user interface which has to be integrated in a sharepoint. As I'm new to sharepoint, I am a bit lost and I don't know what I should choose (developping a Web Application on visual studio which will be hosted on Sharepoint, developping a WebPart...etc I have no idea of what to do).
So my question is : What's the best option to develop this user interface on Sharepoint ?
Thanks
You can go different ways:
Push data from your MySQL database to SharePoint list periodically or event-based.
In this case you already have UI interface of SharePoint list view. If out-of-box UI not enough then you can create your own using javascript or by creating your own web part or by creating SharePoint add-in.
You can do it many ways:
1.1. C# console app (create with Visual Studio). Console app will connect to your SQL database and create list items in SharePoint list. You can schedule this console in Windows Task Scheduler.
1.2. Another periodically running code that external to your database. May be PowerShell script, SharePoint timerjob, Windows service, SharePoint workflow or something else. This code will connect to database and push data to SharePoint list.
1.3. I don't know how you fill your database but in your logic you can add logic to also create SharePoint list item in list when you add record to database.
It is event-based logic.
Get all data from your database in SharePoint on page load each time.
Add some web part to SharePoint that get data from your database on page load (you can mix some parts below to get intented behavior):
2.1. Create your own Visual Web Part in Visual Studio. Deploy solution with web part to SharePoint. Add web part to any page in SharePoint.
This web part will get data from your database on page load.
2.2. You can create web service hosted anywhere (SharePoint, another place) that return data from your database.
Create javascript logic that call this web service to get data and render data.
Add this javascript logic in Content Editor or Script Editor web part in SharePoint. CE and SE web parts is out-of-box web parts, you don't need to develop this.
2.3. Create SharePoint add-in that will get data from web service.
2.4. etc ....
May be I can suggest other options if you specify more precise requirements to implementation.
Just say how you see it in your imagination and I can suggest ways how to implement it.
Describe how it must be from user experience. Like 'I see page where I have three green buttons, color highlighted rows, auto-calculated field and so on and so on. I click button and get following result... ". Describe your expected user experience.
About trends - javascript rules now. In SharePoint Online you cannot create server code solutions hosted in SharePoint.
Best solution to use javascript to not change many things on migration to different version of SharePoint.

Run Excel macro when excel is not installed

I have a excel workbook. I need to show it as a HTML page that will be refreshed automatically(say every 2 minutes). For that i need to run the calculations on every sheet and then save as HTML. I will figure out later how to swap the new HTML file for the old one later. I already have a macro in excel that does all the calculations and then saves as HTML every 2 min. All i need to do is call that macro
The problem is that the machine on which all this is to take place is a server machine and thus MS office cannot be installed on it. Thus i cannot use Excel COM Inter-op.
One was is if i could write a .net program or a Vb Script that will run the macro. But a .net program always uses inter-op.
Another way is if i could save the book as a HTML and run the macro in the HTML itself(Dont know if the HTML has the VB A code). Here also i found that i require Visual Basic Editor which i cant install( as it comes with excel only).
I would prefer not to use third party soft wares.
Can any of the above two procedures be implemented in the given conditions? if not is there any other way?
UPDATE:
Have been looking into open XML for a solution and have finally found that open XML 2.0 cannot run excel calculations as the SDK does not have the calculation engine. Does open XML SDK 2.5 have the calculation engine??
In short: You cannot run a macro without Excel installed. Worse: You should not intsall Excel on a Server. It is not recommended and impossible to do this in a stable way.
My best bet would be something like this: Use a :net library which can read xlsx files, like EPPLUS and "translate" this macro into net, which the EPPLUS library as its foundation. Also, this is a lot fastrer than Interop (factor 10 - 100) and fits better into a Server infrastructure with ASP.NET (for example).
Have you considered putting the macro as a .NET Managed AddIn on a shared machine, executing the macro from the server using a shell command to open Excel on the shared machine and the macro runs on Open.
Then you can get the macro itself to export the data to HTML and copy the pages to your server.
As has been said, avoid installing Office on a server (though it has been done in the past, it's never advisable)
Most robust option would be to re-write your vba in .NET as a .NET Managed AddIn - then you have more control over processes, but as has been pointed out, NOT on a Server.
Thanks for the resonses. Found a way to show the excel as HTML in the given conditions.
Just FYI, I used a project known as NPOI. It is the .net version of POI used in java. It allows me to open edit and save excel workbooks without installing excel. plus it is opensource so i customized it according to my requirements.
https://npoi.codeplex.com/
https://github.com/tonyqus/npoi

How do I regenerate a DataContext.designer.cs file from a CC.Net build script

We use Linq2Sql and CruiseControl.NET. Visual Studio likes to rebuild the register any layout change on the DBML designer as a change to the DBML. This forces it to regenerate the DataContext.designer.cs and DataContext.layout files. This, in turn, causes spurious conflicts with Subversion when we go to commit.
I would like to svn:ignore the .designer.cs and .layout files to avoid the conflicts, and let our CI server generate them as part of the build process. MSBuild, which works well for building the rest of our project, does not generate the .designer.cs files.
Normally, those files are built upon save of the .DBML within Visual Studio using the custom tool MSLinqToSQLGenerator. I need to be able to do it unattended without running Visual Studio.
How do I do this?
Based mostly on this question, but also this question, this question and my own experience, I don't think it's possible without a lot of ugliness, pain or without converting your LINQ to SQL code generation over to T4 (not appealing, IMO).

SSRS Dynamic Shared Data Source

I have an ASP.Net Web site that displays various SSRS reports using the Microsoft Report Viewer Control. I need to be able to specify a data source at runtime. It seems like I should be able to just specify the name of a "shared" data source when I render the report, but I sure can't find a way to do that. The only thing I've found so far that works is to use an "embedded" data source. I'm not real crazy about that, but if that's my only option it will have to do.
Anybody know how to specify a shared data source at runtime?
This question is a little old, but if there is already a custom app accessing SSRS reports this Code Project might be a good solution.

After a report / document template tool to generate documents from SQL Server

I'm after a tool to generate decent-looking documents from templates, that needs to:
be invoked through code (not interactively)
run on Windows, ideally invoked from code within a web-server
process standalone* report files that contain their own internal data definitions, query options, etc (i.e. ideally so that we can push simple report files to the server, and it simply work - where report/document maintenance is not necessarily a developer activity)
access data from a database (SQL Server 2005) based on parameters (ids etc) that we pass in
export (again, through code) to pdf or similar
*= where standalone simply means that the report is fully self-describing; it is fully expected that additional reporting runtime components will be required to execute the report. Contrast to rdlc which uses the data-sets from the local VS project.
I looked at the rdl/rdlc options (Visual Studio 2008), but rdlc seems to be coupled to the assembly (not standalone), and rdl seems to lack the code-based export ability. The version of Crystal Reports included in VS2008 seems very similar to rdlc - presumably the full Crystal Reports offering has more functionality, but has a non-trivial price tag too...
I'd welcome any suggestions for an appropriate, professional looking tool that might be suitable and recommended...
I think SQL Reporting Services fully support all of your requirements.
I have build some sophisticated solutions myself with SSRS.
(Example)
Fully manageable through code (via SSRS WS) (Upload, execute and export Reports)
Used SQL Server as database
Queries are defined in RDL (or Stored Proc) and based on parameters
There are other solutions like Telerik Reporting or Data Dynamics ActiveReport, but they are not free.
Let me know if you need more informations
SSRS WS: With that I mean the Web Service Interface (Report Server Web Service
). There is also a URL Access method, but I don't think it's a solution for you
I dont think you can satisfy all requirements. Number 3 especially is the killer.
On one reading, I see it as adhoc reporting generating it's on SQL. On another, it is giving users "empowerment" to do roll their own within some limits you define?
You may have looked already... but have you thought about using the ReportBuilder functionality to set up the basics and leave users to do the rest? You'll need a report monkey at some point anyway to set soemthing up.
Edit, after comment:
Reporting Services it is then.
It comprises a web service that renders RDL files uploaded from VS.
Report Builder is a template for users to hack and bash their own within the limits and environment you set.
Architecture of RS 2008
Our Data Dynamics Reports product sound like it is for you. It is a fully programmable reporting component for .NET / Visual Studio. View the documentation on the API here. You can export the reports to any of our various formats, including PDF, HTML, and Excel and it also includes an end user designer control that you can embed into your own applications to let end users modify or create their own reports.
The reports are stored in RDL - the same XML dialect that Reporting Services uses - in fact you can take any existing RDL files and open them in Data Dynamics Reports. In addition to compatibility with RDL, we add many more features, such as "themes" to consistently style your report, master reports (think ASP.NET master pages for reports), and several other built in controls such as a calendar, barcode, and dashboard controls to name a few.
Now lets look at your requirements one-by-one and see how Data Dynamics Reports might solve them:
be invoked through code (not interactively) - Data Dynamics Reports includes comprehensive API.
run on Windows, ideally invoked from code within a web-server - You can use Data Dynamics Reports in client-based, or ASP.NET applications, it even support medium trust ASP.NET applications (webservices are fine).
process standalone* report files that contain their own internal data definitions, query options, etc (i.e. ideally so that we can push simple report files to the server, and it simply work - where report/document maintenance is not necessarily a developer activity) - Data Dynamics Reports uses standard RDL (not rdlc) which includes all information bout how to retrieve data from your datasource. We also include an end user designer control to allow you to emebed a design environment for these standalone files into your own applications.
access data from a database (SQL Server 2005) based on parameters (ids etc) that we pass in - Data Dynamics Reports includes comprehensive support for parameters (even get the "valid values" from a query.
export (again, through code) to pdf or similar - Data Dynamics Reports supports exporting to PDF, HTML, Excel, Word, images, and XML.
I hope it works out for you, and let me know if you have any additional questions.
Scott Willeke
Data Dynamics / GrapeCity inc.
I think, based on all the criteria, you likely need to look at Crystal Reports, since you want the reports to be standalone, although, you could also create a report designer out of XtraReports or ActiveReports Pro and have much of the same functionality.
As for running it on the fly and having it generate, distribute, and archive the reports that run, check out our product at www.versareports.com. It should work with any .NET report designer you want to use and provides the enterprise-class report server framework you likely need.