This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - How to call a predefined search from an external HTML page

CycleOp - Monday, April 18, 2011 8:56 AM:

Hi,

Is there a way to retrieve items using a predefined search (or just using some search criteria), where  this call is initiated from an external HTML page ?

I thought of using javascript, but the way to call the undocumented functions like ShowItemEx is not clear to me.

All help is greatly appreciated.

Thanks.



Brian - Tuesday, April 19, 2011 8:13 AM:

Hi Sagi,

The trick to this is to get access to the "aras" object that is inside Javascript calls when launched from inside Innovator.

If you put this at the top of your External HTML page then you can call all the normal functions that you would use inside Innovator.

var aras = window.opener.top.aras;
var inn = top.aras.newIOMInnovator();

Normal Item calls will now work using the inn object to create the new items.

var prt = inn.newItem("Part","get");
etc.

Now you still have to have called this window from Innovator which you could do via an action calling a method like this:

var win = window.open("url of html page", "windowName", "width=800,height=800,resizable=1");
top.aras.uiRegWindowEx("windowName",win);
return true;

 Hope this answers your question.

Cheers,

Brian.



CycleOp - Thursday, April 21, 2011 12:59 AM:

Thanks Brian :-)

I got it to work by calling the Javascript function below:

function CallPreDefSearch(savedSearchId)

{

var ssInToc = new top.main["tree"].SavedSearchInToc(savedSearchId);

ssInToc.Select();

ssInToc.onClick();

}

 

The savedSearchId is the internal ID of a pre-defined saved search. You can see all saved search from the Administration folder