Vardhan - Monday, May 12, 2014 5:59 AM:
Hi,
I am not able to generate Users 'Inactive Accounts' report in Innovator 10.0 by using Firefox. Same is working in IE.
http://www.aras.comhttp://www.aras.com/Community/forums/t/4611.aspx A resent post with the same issue says javascript dialog can not be closed in Firefox. If so, how to solve this issue?
Thank you.
Brian - Tuesday, May 13, 2014 12:21 AM:
Hi Vardh,
Since Mozilla consider is a security risk of some sort to allow the dialog to close from javascript we need to do something a little different.
Create a new method (Client side, Javascript) and call it "GetInactiveAccounts_2". Paste this code into it. This is basically the same code the other report uses except that it uses a javascript "prompt" window to retrieve the value rather than a popup dialog box.
var a = top.aras;
var retVal = "<H4>Inactivity Duration is incorrect</H4>";
var duration = prompt("Enter inactive period (days)", "5");
var tmpDom = a.createXMLDocument();
if (duration && parseInt(duration)>0)
{
duration = parseInt(duration);
aml2send = "<Item type='User' action='do_l10n' initial_action='get' select='login_name,first_name,last_name,last_login_date,created_on' order_by='[User].last_login_date DESC'/>";
tmpDom.loadXML(aml2send);
tmpDom.selectSingleNode("//Item").setAttribute("where", "DATEDIFF(d, IsNull([User].last_login_date, [User].created_on), getutcdate())>="+duration);
r = a.applyItem(tmpDom.xml);
if (r && r.indexOf("<Result") < 0){
r = "<Result>"+r+"</Result>";
}
var reportNm = "Inactive Accounts";
var reportNd = a.getItem("Report", "name='"+reportNm+"'", "<name>"+reportNm+"</name>", 0);
if (reportNd)
{
tmpDom.loadXML(r);
var xslStr = a.getItemProperty(reportNd, "xsl_stylesheet");
retVal = a.applyXsltString(tmpDom, xslStr);
}
else{
retVal = "<H4>Report (name="+reportNm+") not found</H4>";
}
}
return retVal;
Now go to "Reports" under Administration and find the "Inactive Accounts" report.
Edit this report and change the "Method" from "Core_GetInactiveAccounts" to your new method "GetInactiveAccounts_2"
Save the report.
Go to Users and run the report.
Hope this helps.
Brian.
Vardhan - Tuesday, May 13, 2014 2:33 AM:
Thank you very much Brian. Worked great.
But what could be the solution if I need to create a dialog with some other controls like Radio buttons, Lists etc. Prompt() will not work here. For ex: I want to generate the same report for Users whose Manager is x. For this I need to add a Drop down with all managers names to the dialog.
If I create the dialog using HTML and javascript I can't be able to close that in Firefox.
Thank you. Vardh
Brian - Tuesday, May 13, 2014 3:08 AM:
Hi Vardh,
I have not tested this but I think the solution is to open a window rather than a dialog.
Create your own html page, put it in the code tree, execute your code including calling the report and have the window dismiss itself when the report runs.
Hope this helps,
Brian.