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 - Notification Messages

tstickel - Wednesday, March 6, 2013 11:14 AM:

The Notification Message itemtype allows the administrator to create popup messages targeted to Identities.  One of the options in the message setup is to supply the complete HTML for the message, instead of using the standard template.  I have the HTML setup defined and the message is being displayed correctly.

However, I have some javascript in the message where I attempt to open a specific part Form when the user clicks on a button in the message.  I can not get this to work because I can not get access to the top.aras object.  I tried setting the top.aras object = arguments.aras.  The arguments object exists, but it does not have a property named "aras". I can not find a way to tell what properties the arguments object has.  Here is the html I am using:

<!DOCTYPE html>
<html>
 <head>
 <script>
 function myFunction()
 {
top.aras = arguments.aras;

top.aras.uiShowItem("Part", "A8918EEE54224AAD9433C0D5ABD4C86C");
 }
 </script>
 </head>
 <body>

 <input type="button" onclick="myFunction()" value="Open Customer Record">

 </body>
 </html>

Has anybody done something like this?



tstickel - Wednesday, March 6, 2013 1:21 PM:

I was able to resolve this problem by modifying the user_notifications.js file found in the installation client/scripts folder.  A segment of the code in this file sets parameters (e.g. dialogHeight) that are accessible to the javascript in my HTML file.  I just added a parameters.toparas = top.aras; statement in user_notifications.js.  Then in my javascript I used top.aras = this.parameters.toparas; instead of what I was trying before.

NOTE: This involved modifying the ARAS-supplied user_notifications.js file.  In futute upgrades to Innovator this file will likely be replaced and my changes will be lost unless I take actions to reimplement them.  I suspect that ARAS would not recommend that customers take this approach.