Solved

Open url and fire javascript function directly from link in Excel

Posted on 2013-06-11
6
715 Views
Last Modified: 2013-06-14
Hi, my organization is using Microsoft Dynamics CRM which is a system running in Internet Explorer. I'm building a system, which provides reports with among other things direct links to relevant pages in the CRM system. For most pages this is no problem as it is possible to navigate to these directly using a url. However I need to navigate to a custom built CRM page, which I can see in the source is entered using a javascript function (fired with onclick). The onclick argument looks like this:

openIsvWin('\x2fISV\x2fXXX.CRM.CustomerProductSheet\x2fCustomerOverviewSite.aspx', true, -1, '')

What I want to do is to provide a link in the report (a PDF file) that can navigate to the crm system and then fire this code in order to finally end at the desired page. Is this possible?
If it is not possible in a single link, then another possibility is to link to a small network stored batch/exe that does this - still I dont know how to do it.
0
Comment
Question by:andreas_rafn
  • 3
  • 3
6 Comments
 
LVL 27

Expert Comment

by:Chinmay Patel
ID: 39242182
Hi andreas_rafn,

I won't recommend chasing after this. Being a product these things will change and that too without notifying you and might not be very pleasant experience for the end user.

If you can explain what exactly you are trying to achieve I might be able to help you.
Opening up a URL is fine, passing few parameters in QueryString is also but opening up a popup from PDF using some external JS is not possible(AFAIK)

Regards,
Chinmay.
0
 

Author Comment

by:andreas_rafn
ID: 39243627
Thanks for your answer,

I know that its not ideal, but the reporting system is under constant development and maintenance, so we can implement and release changes from day-to-day. Due to organizational constraints, we cannot do it the right way (we don't have authority to tinker with the CRM system), so simply linking is the best way right now as cost benefit wise it is beneficial to do it the simple non sustainable way I described and simple change the code/link definitions along with changes in the system it targets, which btw doesn't change that fast to my knowledge.

Unfortunately its (AFAIK) not possible to access the page by a simple url with query string arguments. Its seems that the way to go is in two steps:

1. go directly to the CRM customer page using a link (this can be done using a simple url containing the guid of the customer, which is obtained by the system)
2. Fire the described script from that page, taking the user directly to the custom sub page of the customer page

As set using a batch script or exe to do both in go is ok, because I can easily store it at a corporate network location and link to that in the PDF.

Hope anyone can help with this.
0
 
LVL 27

Expert Comment

by:Chinmay Patel
ID: 39243685
Opening the page is possible and very simple. My comment was for calling a script on that page. Basically the page will have to be modified to accommodate this. You can write an On Load script for the same. That will look for a specific query string in URL and trigger the script you want.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:andreas_rafn
ID: 39245871
The problem is that I don't and will probably not get authority to make the CRM developers make this simple change (its a very rigid organization where sub organizations do not work too well together).

So I need to open the page constrained by the way things are now. And i still don't know how to do that in a good way. The only way I can think of is to make a small application that uses the Internet Explorer (browser used for CRM) API through which I can first open the customer page and then fire the javascript. But to me it just seems crazy that I need to create and link to an application in order to provide a direct link to the page in the PDF, I'm not very experienced in web development that's why I'm asking if there is an easier way than what I'm proposing - there surely must be?
0
 
LVL 27

Accepted Solution

by:
Chinmay Patel earned 500 total points
ID: 39246574
No. There is no easier way to achieve this. You have to understand it from a Web Developer's side as well and(from CRM side as well). Any web application should not allow launching of a URL then automatically call a function on available to page. You can think of various mischiefs people can pull off if this was possible. That's what the page should have that mechanism so based on a query string value it can execute certain logic on its own but not by a users' request.

Also I don't blame your CRM developers too. I was used to make changes but not now. I won't touch such requests with a 100 feet bamboo... it has become inherently risky and difficult to manage such unsupported customizations. I think if you absolutely have to provide that functionality then building that app is the only way out. Just in case I didn't understood your problem I have put down my understanding of it below:
 
 - From a report/PDF a CRM URL needs to be opened
 - and then when the page loads a function on that page should automatically be called.

If above is your requirement then sorry my friend I don't think there is any other simpler way to achieve this. CRM checks for its parent window but you are try to write a web page that will load the URL and then try to call that function on the page(instead of making an application to do so).
0
 

Author Closing Comment

by:andreas_rafn
ID: 39248906
Not the answer I was hoping for, but I definitely got wiser, so thank you for your feedback.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
On Sep 22nd 2014 Microsoft released Update Rollup 1 for Microsoft Dynamics CRM 2013 Service Pack 1 and back in July Update Rollup 3 was released.  So we now have:   Update Rollup 1Update Rollup 2Update Rollup 3Service Pack 1Update Rollup 1 for S…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now