09-20-2022, 08:36 PM
(This post was last modified: 09-20-2022, 08:42 PM by defaultuser.)
Hello,
We have code that after clicking a link with parameters, the user is directed to javascript code that redirects them to their already open instance of the Delphi project, updated with parameters from the link they clicked on. However, after stepping into the code that calls the Delphi function and inspecting the res variable it is null, and I am not able to trace it into Delphi. Below is a sample of the Javascript code.
on the 'res = win1.functionwithinDelphi(acctnbr, reqid);' line is where the Delphi code is to executed, however, it does not work on Chrome or Edge. Is there a workaround for this?
We have code that after clicking a link with parameters, the user is directed to javascript code that redirects them to their already open instance of the Delphi project, updated with parameters from the link they clicked on. However, after stepping into the code that calls the Delphi function and inspecting the res variable it is null, and I am not able to trace it into Delphi. Below is a sample of the Javascript code.
Code:
function pageInit() {
var res;
getURLParameters();
if ( (acctnbr == "") || (reqid == "") ) {
alert('No account number or request id was passed in from dummy software. Account=' + acctnbr + ' Request ID=' + reqid);
} else {
try {
win1 = window.open("", "ApplicationName", "");
res = win1.functionwithinDelphi(acctnbr, reqid);
if (res == true) {
win1.focus(); }
} catch (ex) {
// If error is that object doesn't support property or method,
// then user is probably not logged into application.
if ( (ex.message.indexOf("annot find submit co") > -1) || (ex.message.indexOf("is null or not an object") > -1) ) {
alert('Application not on main page. Please correct and try again.');
} else {
alert('An error occurred: ' + ex.message + ' Please restart application and then try again.');
}
}
}