Hi…How to run the agent from javascript…
thanks in advance
Hi…How to run the agent from javascript…
thanks in advance
Subject: How to run agent from Javascript
If using an asynch method to call the agent, do this:
function extractInformation(startDate){
//destroy any existing SortableTable objects here. This will ensure that there is only 1 at a time
var url = "ExtractInformationRegister?openagent&START_DATE=" + unescape(startDate);
initRequest(url);
req.onreadystatechange = processRequest;
req.open("GET", url, true);
req.send(null);
}
//initRequest is simply a function that sets up the XMLHttpRequest object. processRequest is the name of the callback function. URL is the url for the agent and any parameters being passed in.
If you simply want to call the agent, use location.search and call the agent via the url. Generally, though, if you are going to do this, why not just submit the form and run the agent with the WQS event? The traditional method should work best in this case. Submitting the form with @command([filesave]);@command([fileclosewindow]) will cause the onSubmit function to trigger and any javascript for validation, etc can be placed here. Once that runs, the WQS event triggers the agent.
Subject: RE: How to run agent from Javascript
thanks i have found some thing…window.location.replace
Subject: RE: How to run agent from Javascript
Sorry, I meant location.replace. location.search property is everything after the ? in the URL, which wouldn’t work in this case unless your agent name was the same as the form name, as this part of the url would not be obtained.