<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5531051101500543810</id><updated>2024-10-17T13:14:24.700-07:00</updated><category term="Basics"/><category term="QTP - Scripts"/><category term="jQuery"/><category term="AJAX"/><category term="Interactive Reports"/><category term="PLSQL"/><category term="QTP - VBScript"/><category term="vt - Access Controls"/><category term="vt - Web Services"/><category term="Administration"/><category term="Application Express 4.0"/><category term="Authorisation Schemes"/><category term="Menu"/><category term="Network ACLs"/><category term="QTP - Browser"/><category term="Time Zones"/><category term="Web Services"/><category term="White Papers"/><title type='text'>Apex Monkeys</title><subtitle type='html'>Apex Monkeys is a collection of Tutorials for Oracle Application Express (formerly known as HTMLDB)&#xa;If you have any Tutorials or Tips which you would like to share please email apex.monkeys@gmail.com.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default?start-index=26&amp;max-results=25'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-2106603378534232029</id><published>2011-04-07T04:19:00.000-07:00</published><updated>2011-04-07T04:19:00.379-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QTP - Browser"/><title type='text'>QTP - Getting current browser URL</title><content type='html'>I&#39;m going to show and explain &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;how to get current URL which is opened in a browser.&lt;/span&gt;&lt;br /&gt;For example, how to get URL &quot;&lt;span style=&quot;font-style: italic;&quot;&gt;http://motevich.blogspot.com&lt;/span&gt;&quot; from the following browser:&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpOhng7r0FXKfbwP6vcdrCnLpUUWFGbUANkaorimN4jeqiykCmrNaZ_xyffg_y2h7sZhdM0OYA-nwfbvq0fxpEdXE7FuysSTk8qG1C0NfDl828LqNEw3BZANmYJ9_NZJFafM1eXsor5qY/s1600-h/1_URL.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpOhng7r0FXKfbwP6vcdrCnLpUUWFGbUANkaorimN4jeqiykCmrNaZ_xyffg_y2h7sZhdM0OYA-nwfbvq0fxpEdXE7FuysSTk8qG1C0NfDl828LqNEw3BZANmYJ9_NZJFafM1eXsor5qY/s400/1_URL.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5201684200414750658&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;There are two solutions:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Using &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;GetROProperty(&quot;URL&quot;)&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt; method&lt;/span&gt; (run-time object property)&lt;/li&gt;&lt;li&gt;Using &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;&quot;URL&quot; property of &quot;Object&quot; &lt;/span&gt;(IE DOM Object)&lt;/li&gt;&lt;/ol&gt;Let&#39;s consider both variants.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;GetRoProperty(&quot;URL&quot;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt; method&lt;/span&gt; &lt;/span&gt;(run-time object property)&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;GetRoProperty&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; function reads &lt;/span&gt;&lt;/span&gt;properties of a run-time object in an application.&lt;br /&gt;If you open QTP Help on &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;GetRoProperty&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; function, you &#39;ll see that this function can work with all objects:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi90LEi98PH2B57_hyewdfQM8GZNYEpIpI5nUngOdaXXK9LGFPSYJZ5eVlO32TzIh4ykwm29lDQxNAnk40ZybP9UXk2m3aCGywkznc1v4WgHz5antwRZqaNhgQm1zJ0ExSpGaJWoqLbE38/s1600-h/1_help_c.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi90LEi98PH2B57_hyewdfQM8GZNYEpIpI5nUngOdaXXK9LGFPSYJZ5eVlO32TzIh4ykwm29lDQxNAnk40ZybP9UXk2m3aCGywkznc1v4WgHz5antwRZqaNhgQm1zJ0ExSpGaJWoqLbE38/s400/1_help_c.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5212912566116865522&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;So, for example:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;to check whether a &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;link is visible or not&lt;/span&gt;, use:&lt;br /&gt;Browser(&quot;bname&quot;).Page(&quot;pname&quot;).Link(&quot;lname&quot;).&lt;span style=&quot;font-weight: bold;&quot;&gt;GetROProperty(&quot;visible&quot;)&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;to get a &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;page&#39;s title&lt;/span&gt;, use:&lt;br /&gt;Browser(&quot;bname&quot;).Page(&quot;pname&quot;).&lt;span style=&quot;font-weight: bold;&quot;&gt;GetROProperty(&quot;title&quot;)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;to check whether a &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;window is maximized&lt;/span&gt;, use:&lt;br /&gt;Window(&quot;wname&quot;).&lt;span style=&quot;font-weight: bold;&quot;&gt;GetROProperty(&quot;maximized&quot;)&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;to get &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;width&lt;/span&gt; of  WebButton, use:&lt;br /&gt;Browser(&quot;bname&quot;).Page(&quot;pname&quot;).WebButton(&quot;btname&quot;).&lt;span style=&quot;font-weight: bold;&quot;&gt;GetROProperty(&quot;width&quot;) &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;Others   properties are described in QTP Help.&lt;br /&gt;&lt;br /&gt;In our case, to &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;get URL of the current WebPage&lt;/span&gt;, we will use:&lt;br /&gt;&lt;div id=&quot;htmlcode&quot; style=&quot;border: 1px solid gray; margin: 10pt; padding: 10pt; background-color: rgb(240, 240, 240);&quot;&gt;Browser(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;bname&quot;&lt;/span&gt;).Page(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;pname&quot;&lt;/span&gt;)&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;GetRoProperty(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;URL&quot;&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;This is a sample QTP script:&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3aLbRktIyGLayl9-OmQLTgwMAPY4f4adFXFm6RI-E5qrPHoFVXFIzndAb7bSrbSQy7a8BHo7aRVeCm2B1j8wmE0Nu5ARgrQ_n0sYLPWHonEIQYodElfe4QQzZLDbA-xaQPDOTu3v7wKg/s1600-h/2_result_c_.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3aLbRktIyGLayl9-OmQLTgwMAPY4f4adFXFm6RI-E5qrPHoFVXFIzndAb7bSrbSQy7a8BHo7aRVeCm2B1j8wmE0Nu5ARgrQ_n0sYLPWHonEIQYodElfe4QQzZLDbA-xaQPDOTu3v7wKg/s400/2_result_c_.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5212923091898753250&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;(Click the image to enlarge it)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;&quot;URL&quot; property of &quot;Object&quot; &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt; &lt;/span&gt;(IE DOM Object)&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;The sample syntax is:&lt;/span&gt;&lt;br /&gt;&lt;div id=&quot;htmlcode&quot; style=&quot;border: 1px solid gray; margin: 10pt; padding: 10pt; background-color: rgb(240, 240, 240);&quot;&gt;Browser(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;bname&quot;&lt;/span&gt;).Page(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;pname&quot;&lt;/span&gt;)&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Object.URL&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;What is &quot;Object&quot; in the above statement?&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Actually, this is &lt;/span&gt;Internet Explorer Document Object Model (DOM) Object.&lt;br /&gt;You can read more about DOM &lt;a href=&quot;http://en.wikipedia.org/wiki/Document_Object_Model&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms533043%28VS.85%29.aspx&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;Also, I recommend to read &lt;a href=&quot;http://support.microsoft.com/kb/238313&quot;&gt;this interested article&lt;/a&gt; on working with IE DOM from Visual Basic.&lt;br /&gt;&lt;span style=&quot;font-style: italic; font-weight: bold;&quot;&gt;&lt;br /&gt;Tip: &lt;/span&gt;You can use DOM Object when running QTP test on Internet Explorer only!&lt;br /&gt;&lt;br /&gt;To make the long story short, I can say that using &lt;span style=&quot;font-weight: bold;&quot;&gt;Object &lt;/span&gt;property you can get almost all elements and properties from Web page.&lt;br /&gt;&lt;br /&gt;Thus, I use &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/cc304096%28VS.85%29.aspx&quot;&gt;URL property&lt;/a&gt; of Internet Explorer&#39;s DOM Object.&lt;br /&gt;All properties, collections, and methods of DOM Object are described in this &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms531073%28VS.85%29.aspx&quot;&gt;MSDN article&lt;/a&gt;.&lt;br /&gt;&lt;span style=&quot;font-style: italic; font-weight: bold;&quot;&gt;&lt;br /&gt;Tip: &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;/span&gt;The number of properties, accessed via &lt;span style=&quot;font-weight: bold;&quot;&gt;DOM Object&lt;/span&gt;, is more bigger, than properties accessed via &lt;span style=&quot;font-weight: bold;&quot;&gt;GetROProperty method&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;So, the result of above code is:&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB8F9QDNHFWwKB75X4_BSrE2FDdM70CChyGwe9cRgzWu2cFTL0pEAusvWk_ArPJM98Wh93rdsP1ixbAyCtVz1ywthnoyRCSMlNF3E8wcP3XapQdGYrP6jKfbVOhSXGwLIJEPT3kCS00e4/s1600-h/3_result_c_.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB8F9QDNHFWwKB75X4_BSrE2FDdM70CChyGwe9cRgzWu2cFTL0pEAusvWk_ArPJM98Wh93rdsP1ixbAyCtVz1ywthnoyRCSMlNF3E8wcP3XapQdGYrP6jKfbVOhSXGwLIJEPT3kCS00e4/s400/3_result_c_.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5212932122563046386&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;(Click the image to enlarge it)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Summary:&lt;/span&gt;&lt;br /&gt;Two ways were discussed:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;GetROProperty(&quot;URL&quot;)&lt;/span&gt; (run-time object property)&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;&quot;URL&quot; property of &quot;Object&quot; &lt;/span&gt;(IE DOM Object)&lt;/li&gt;&lt;/ol&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;GetROProperty method&lt;/span&gt; supports both IE &amp;amp; FireFox, but &lt;span style=&quot;font-weight: bold;&quot;&gt;IE DOM Object&lt;/span&gt; provides more accessible properties and methods.&lt;br /&gt;Both can get URL of the current Web page.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://motevich.blogspot.com/2008/06/qtp-get-current-browser-url.html&quot;&gt;Source&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/2106603378534232029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/qtp-getting-current-browser-url.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/2106603378534232029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/2106603378534232029'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/qtp-getting-current-browser-url.html' title='QTP - Getting current browser URL'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpOhng7r0FXKfbwP6vcdrCnLpUUWFGbUANkaorimN4jeqiykCmrNaZ_xyffg_y2h7sZhdM0OYA-nwfbvq0fxpEdXE7FuysSTk8qG1C0NfDl828LqNEw3BZANmYJ9_NZJFafM1eXsor5qY/s72-c/1_URL.gif" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-3347659509904498408</id><published>2011-04-06T07:11:00.000-07:00</published><updated>2011-04-06T07:11:00.480-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QTP - VBScript"/><title type='text'>quotes in VBScript</title><content type='html'>There two ways to do that:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Double the quotes (&lt;span style=&quot;font-weight: bold; color: rgb(102, 51, 51);&quot;&gt;&quot;&quot;&lt;/span&gt;):&lt;br /&gt;&lt;div id=&quot;htmlcode&quot; style=&quot;border: 1px solid gray; margin: 10pt; padding: 10pt; background-color: rgb(240, 240, 240);&quot;&gt;&lt;span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;MsgBox&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: rgb(102, 51, 51);&quot;&gt;&quot;#1: &quot;&quot;QTP - QuickTest Professional&quot;&quot;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;Use 2 double quotation marks to include a quote character in the string.&lt;br /&gt;So, the result is:&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; border: medium none;&quot; src=&quot;http://lh6.ggpht.com/mangazey/SF6xmEOnaAI/AAAAAAAAAnk/Si6gdpqH0R0/way1_c.gif&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Use ANSI character code - &lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Chr&lt;/span&gt;(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;34&lt;/span&gt;)&lt;/span&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica;&quot;&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica; font-size: 85%; color: black;&quot;&gt;&lt;span class=&quot;spnMessageText&quot; id=&quot;msg&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div id=&quot;htmlcode&quot; style=&quot;border: 1px solid gray; margin: 10pt; padding: 10pt; background-color: rgb(240, 240, 240);&quot;&gt;&lt;span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;MsgBox&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: rgb(102, 51, 51);&quot;&gt;&quot;#2: &quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; &amp;amp; &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Chr&lt;/span&gt;(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;34&lt;/span&gt;) &amp;amp; &lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;QTP - QuickTest Professional&quot;&lt;/span&gt; &amp;amp; &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Chr&lt;/span&gt;(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;34&lt;/span&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;Since, the ANSI code if quotation mark = &lt;span style=&quot;font-weight: bold; color: rgb(102, 51, 51);&quot;&gt;34&lt;/span&gt;, we can use &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;Chr&lt;/span&gt; function.&lt;br /&gt;The result is:&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; border: medium none;&quot; src=&quot;http://lh3.ggpht.com/mangazey/SF6zQAOwK4I/AAAAAAAAAns/n3p93BRON0A/way2_c.gif&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;a href=&quot;http://motevich.blogspot.com/2008/06/qtp-quotes-in-vbscript.html&quot;&gt;Source&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/3347659509904498408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/quotes-in-vbscript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/3347659509904498408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/3347659509904498408'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/quotes-in-vbscript.html' title='quotes in VBScript'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/mangazey/SF6xmEOnaAI/AAAAAAAAAnk/Si6gdpqH0R0/s72-c/way1_c.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-8575333241986719192</id><published>2011-04-05T07:10:00.000-07:00</published><updated>2011-04-05T07:10:00.988-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QTP - Scripts"/><title type='text'>How to set/get system time and date?</title><content type='html'>QTP allows running different types of test. And sometimes, it needs  perform time and date manipulations on a computer. In this article, I  will show and explain - how to get system time/date and change them.&lt;br /&gt;&lt;br /&gt;Actually, today&#39;s lecture consists of two questions:&lt;br /&gt;&lt;ol&gt;&lt;li style=&quot;color: rgb(0, 0, 153);&quot;&gt;How to &lt;span style=&quot;font-weight: bold;&quot;&gt;get &lt;/span&gt;system time and date?&lt;/li&gt;&lt;li style=&quot;color: rgb(0, 0, 153);&quot;&gt;How to &lt;span style=&quot;font-weight: bold;&quot;&gt;set &lt;/span&gt;system time and date?&lt;/li&gt;&lt;/ol&gt; Let start training right now :)&lt;br /&gt;So, the first section is:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;How to get system time and date?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Actually, this is not difficult task! Use the following functions:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;Now&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 0, 153);&quot;&gt; &lt;/span&gt;- function returns the &lt;span style=&quot;font-style: italic; font-weight: bold;&quot;&gt;current date and time &lt;/span&gt;according to the setting of your computer&#39;s system date and time.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;Date&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 0, 153);&quot;&gt; &lt;/span&gt;- function returns the &lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;current system date&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;Time &lt;/span&gt;- function returns a Variant of subtype Date indicating the &lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;current system time&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;So, the code is very simple. I provide it with a screen shot containing results:&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtleUjYosT3xT2F1jB0HYHVKFjWjgIQc6pRFZlKMf3AVoN7Irzj3yrbuJreJ3gCKfo_3vuO6ZZKYDYiZkaBiFjstigUmAHcB3ReX82kXb_KVlgq_TqRl15-vL3G4QA5Ps_BxpOfOTeL9E/s1600-h/GetDateTime_c.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtleUjYosT3xT2F1jB0HYHVKFjWjgIQc6pRFZlKMf3AVoN7Irzj3yrbuJreJ3gCKfo_3vuO6ZZKYDYiZkaBiFjstigUmAHcB3ReX82kXb_KVlgq_TqRl15-vL3G4QA5Ps_BxpOfOTeL9E/s400/GetDateTime_c.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5125733233737635106&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Well, let&#39;s deal with the second section:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;How to set system time and date?&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;br /&gt;For that, I will use simple DOS commands:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;time&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt; &lt;/span&gt;- this command displays or sets the system time:&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi82vMjQb-ldsC3_Ckz7ssmVBigAbpGqVYGFl3qB7K-Vqh91xmW55nQYUsrCu70sRG6CUM5oOkssP78q4L7VHQq8J9UYsA-dwUtngK2NVv2mRBG2QAnLFmJ2lO3jIpyei0Jhps1kaayZuE/s1600-h/time_command_c.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi82vMjQb-ldsC3_Ckz7ssmVBigAbpGqVYGFl3qB7K-Vqh91xmW55nQYUsrCu70sRG6CUM5oOkssP78q4L7VHQq8J9UYsA-dwUtngK2NVv2mRBG2QAnLFmJ2lO3jIpyei0Jhps1kaayZuE/s400/time_command_c.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5126041260202169650&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;To change the time, pass it as a parameter to &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;time&lt;/span&gt; command. See the above screen shot  as an example.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;date&lt;/span&gt; - this command displays or sets the system date:&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6gyPvjrzsNQR46uc6EkW1mUbgi66Xf9vxpQdLV0ycAuWnRaPCCY77InRoR4t-Z6L-GR-p25wBddZNstcPyElzk-RI6CtK1xcL5C4n6460yrQbZys_BMzOxD2F6Ni2jdUvnI_78W9zrBw/s1600-h/date_command_c.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6gyPvjrzsNQR46uc6EkW1mUbgi66Xf9vxpQdLV0ycAuWnRaPCCY77InRoR4t-Z6L-GR-p25wBddZNstcPyElzk-RI6CtK1xcL5C4n6460yrQbZys_BMzOxD2F6Ni2jdUvnI_78W9zrBw/s400/date_command_c.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5126043656793920834&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;To change the date, pass it as a parameter to &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;date&lt;/span&gt; command. See the above screen shot  as an example for date manipulations :)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span&gt;Now, I will combine all the above VBScript functions (&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;Now&lt;/span&gt;, &lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;Date&lt;/span&gt;, &lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;Time&lt;/span&gt;&lt;span&gt;) and DOC commands (&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;time&lt;/span&gt; and &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;date&lt;/span&gt;&lt;span&gt;):&lt;br /&gt;&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjalYqw7P_mMUOUIXnKJM7WJ05IgrNDEJ4zWsml4HamIaMi21wUc4xmASbX4LN1EmcioG5gLHhEs3Q8aO1_77JeyIIbzwPABDQfUStjJ0fQuc289PJ_MN1OFay_qCnSMQ07NgpftsTbdOk/s1600-h/full_source_code_c.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjalYqw7P_mMUOUIXnKJM7WJ05IgrNDEJ4zWsml4HamIaMi21wUc4xmASbX4LN1EmcioG5gLHhEs3Q8aO1_77JeyIIbzwPABDQfUStjJ0fQuc289PJ_MN1OFay_qCnSMQ07NgpftsTbdOk/s400/full_source_code_c.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5126055480838886738&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;As you can see, initial date and time were &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&#39;26.10.2007 22:45:10&#39;&lt;/span&gt;. Then I added &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;3 days and 2 hours &lt;/span&gt;to initial date &amp;amp; time. The result of addition is - &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&#39;30.10.2007 0:45:10&#39;&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;By  the way, could you guess, why the result day is 30th, not 29th? :) To  answer, please pay attention that we added 2 hours too :)&lt;br /&gt;&lt;br /&gt;The last step - running of &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;time&lt;/span&gt; and &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;date&lt;/span&gt;&lt;span&gt; commands from command line. I used &lt;span style=&quot;font-weight: bold;&quot;&gt;Run&lt;/span&gt; method  of &lt;span style=&quot;font-weight: bold;&quot;&gt;WScript.Shell&lt;/span&gt; object.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, as you can see - date and time manipulation is easy enough.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://motevich.blogspot.com/2007/10/qtp-set-get-system-time-date.html&quot;&gt;Source&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/8575333241986719192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/how-to-setget-system-time-and-date.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/8575333241986719192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/8575333241986719192'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/how-to-setget-system-time-and-date.html' title='How to set/get system time and date?'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtleUjYosT3xT2F1jB0HYHVKFjWjgIQc6pRFZlKMf3AVoN7Irzj3yrbuJreJ3gCKfo_3vuO6ZZKYDYiZkaBiFjstigUmAHcB3ReX82kXb_KVlgq_TqRl15-vL3G4QA5Ps_BxpOfOTeL9E/s72-c/GetDateTime_c.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-2933021918773421200</id><published>2011-04-04T07:09:00.000-07:00</published><updated>2011-04-04T07:09:00.248-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QTP - Scripts"/><title type='text'>How to minimize/maximize QTP window?</title><content type='html'>This is very useful feature - &lt;span style=&quot;font-weight: bold;&quot;&gt;minimize QTP window &lt;/span&gt;before script execution. It allows to observe a desktop or an application under test wholly.&lt;br /&gt;&lt;br /&gt;I will show and describe &lt;span style=&quot;font-weight: bold;&quot;&gt;how to minimize (or maximize) QTP window programmatically - i.e. from QTP script.&lt;/span&gt;&lt;br /&gt;Also,  provided approach can be applied to minimize (maximize) any required  window - Browser, Notepad, MS Word or Excel, and so on.&lt;br /&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;br /&gt;&lt;/span&gt;There are two ways to minimize QTP window:&lt;/p&gt;  &lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;b&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;Using Minimize method of Window object&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;b&gt;Using QTP Application      object - QuickTest.Application &lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 12pt;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;br /&gt;These methods will contain several lines only and I hope that my explanations will be understandable.&lt;br /&gt;So,  let&#39;s explore!&lt;/span&gt;&lt;/p&gt;  &lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;b&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;Using Minimize method of Window object&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;You can use &lt;span style=&quot;font-weight: bold; color: rgb(102, 51, 51);&quot;&gt;Minimize &lt;/span&gt;method of &lt;span style=&quot;font-weight: bold;&quot;&gt;Window &lt;/span&gt;object to minimize QTP window (or any other).&lt;br /&gt;&lt;br /&gt;Let&#39;s see two cases - when a window &lt;span style=&quot;font-weight: bold;&quot;&gt;is &lt;/span&gt;located in Object Repository (OR) and &lt;span&gt;widows &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;is not &lt;/span&gt;located in OR.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;If a window &lt;span style=&quot;font-weight: bold;&quot;&gt;is located in Object Repository (OR)&lt;/span&gt;, then minimizing can be performed using the following code:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt; &lt;div style=&quot;border: 1px dotted rgb(160, 160, 160); margin: 0pt; padding: 0pt; background-color: rgb(240, 240, 240); color: rgb(0, 0, 153); width: 95%; font-family: &#39;Courier New&#39;,Courier,monospace; font-size: 90%;&quot;&gt;&lt;br /&gt;&lt;ol style=&quot;font-weight: bold;&quot;&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;hWnd = &lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Browser&lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;browser_name&quot;&lt;/span&gt;).&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;GetROProperty&lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;hwnd&quot;&lt;/span&gt;)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Window&lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;hwnd:=&quot;&lt;/span&gt; &amp;amp; hWnd).&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;Minimize&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt; &lt;/div&gt; &lt;span style=&quot;color: rgb(0, 0, 0);&quot; lang=&quot;EN-US&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot; lang=&quot;EN-US&quot;&gt;In first line, we get window handle (hWnd) of &lt;span style=&quot;font-weight: bold;&quot;&gt;Browser&lt;/span&gt; object . And then we pass this handle to &lt;span style=&quot;font-weight: bold;&quot;&gt;Window&lt;/span&gt; object and minimize it.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Obviously, that we can use the same approach to maximize window (use  method):&lt;/span&gt;   &lt;div style=&quot;border: 1px dotted rgb(160, 160, 160); margin: 0pt; padding: 0pt; background-color: rgb(240, 240, 240); color: rgb(0, 0, 153); width: 95%; font-family: &#39;Courier New&#39;,Courier,monospace; font-size: 90%;&quot;&gt;&lt;br /&gt;&lt;ol style=&quot;font-weight: bold;&quot;&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;hWnd = &lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Browser&lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;browser_name&quot;&lt;/span&gt;).&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;GetROProperty&lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;hwnd&quot;&lt;/span&gt;)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Window&lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;hwnd:=&quot;&lt;/span&gt; &amp;amp; hWnd).&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;Maximize&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt; &lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;If a window &lt;span style=&quot;font-weight: bold;&quot;&gt;is not located in Object Repository (OR)&lt;/span&gt;, then we can use some run-time object properties &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;and descriptive programming &lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;to identify a window. For example, we can use window title.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Please, see a screen shot of QTP window:&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzlre48r6vz97wcwvQVAvWwrdTL98KuRF22HqlRj0_C-03L8Atf_eIyzgTUxonYU1cEnWHFEyPGJS41p8p-DtJ19GJs8sEQNPRa7z-Jz8UD5RG7eo_bTIl6f4kyii2uWfNNW2Yp-k1KY8/s1600-h/01_QTP_window_c.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzlre48r6vz97wcwvQVAvWwrdTL98KuRF22HqlRj0_C-03L8Atf_eIyzgTUxonYU1cEnWHFEyPGJS41p8p-DtJ19GJs8sEQNPRa7z-Jz8UD5RG7eo_bTIl6f4kyii2uWfNNW2Yp-k1KY8/s400/01_QTP_window_c.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5142032986668543042&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;QTP window title has a prefix - &lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;&#39;QuickTest Professional - &#39;&lt;/span&gt; followed by test name. I will use this prefix (&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 153);&quot;&gt;&#39;QuickTest Professional - &#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;) with a mask:&lt;/span&gt;    &lt;div style=&quot;border: 1px dotted rgb(160, 160, 160); margin: 0pt; padding: 0pt; background-color: rgb(240, 240, 240); color: rgb(0, 0, 153); width: 95%; font-weight: bold; font-family: &#39;Courier New&#39;,Courier,monospace; font-size: 90%;&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;sTitleMask = &lt;/span&gt;&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;QuickTest Professional - .*&quot;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Window&lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;regexpwndtitle:=&quot;&lt;/span&gt; &amp;amp; sTitleMask).&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;Minimize&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt; &lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;I use &lt;a href=&quot;http://en.wikipedia.org/wiki/Regular_expression&quot;&gt;Regular Expressions&lt;/a&gt;.&lt;br /&gt;Mask &lt;/span&gt;&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;.*&quot; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;means &quot;match any characters zero or more times&quot;. So, this mask will identify QTP window, and this code will minimize it.&lt;/span&gt;  &lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;The same approach can be applied to Browser.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;See a screen shot of this browser:&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitXdpLVMsB1Huc1HCueLKQ1El17n108csPnWZ-t7VhuBqJXU7fhGEg2MnOeSqlZcfSOI-_cS0lQzHLjsAQXibEN74CQQE3OP86XDJlZ4Tc_liQKidUp3Vx4TOM1_BCuY6JJxjzSqlUQjg/s1600-h/02_browser_c.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitXdpLVMsB1Huc1HCueLKQ1El17n108csPnWZ-t7VhuBqJXU7fhGEg2MnOeSqlZcfSOI-_cS0lQzHLjsAQXibEN74CQQE3OP86XDJlZ4Tc_liQKidUp3Vx4TOM1_BCuY6JJxjzSqlUQjg/s400/02_browser_c.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5142060397149826130&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;In this case, browser has prefix &#39;Google - &#39;. So, I will use it as the mask:&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt; &lt;div style=&quot;border: 1px dotted rgb(160, 160, 160); margin: 0pt; padding: 0pt; background-color: rgb(240, 240, 240); color: rgb(0, 0, 153); width: 95%; font-family: &#39;Courier New&#39;,Courier,monospace; font-size: 90%;&quot;&gt;&lt;br /&gt;&lt;ol style=&quot;font-weight: bold;&quot;&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;sTitleMask = &lt;/span&gt;&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;Google - .*&quot;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Browser&lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;regexpwndtitle:=&quot;&lt;/span&gt; &amp;amp; sTitleMask).&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;GetROProperty&lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;hwnd&quot;&lt;/span&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Window&lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;hwnd:=&quot;&lt;/span&gt; &amp;amp; hWnd).&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;Minimize&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt; &lt;/div&gt; &lt;span style=&quot;color: rgb(0, 0, 0);&quot; lang=&quot;EN-US&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Well, you can use any approach you like. All of them work and minimize/maximize windows correctly.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;color: rgb(0, 0, 153); font-weight: bold;&quot;&gt;Using QTP Application      object - QuickTest.Application&lt;br /&gt;&lt;span style=&quot;font-weight: normal; color: rgb(0, 0, 0);&quot;&gt;Since this approach uses QuickTest Automation Object Model, it can be applied to QTP window only.&lt;br /&gt;&lt;br /&gt;There is a procedure, which minimizes QTP window:&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;  &lt;div style=&quot;border: 1px dotted rgb(160, 160, 160); margin: 0pt; padding: 0pt; background-color: rgb(240, 240, 240); color: rgb(0, 0, 153); width: 95%; font-family: &#39;Courier New&#39;,Courier,monospace; font-size: 90%;&quot;&gt;&lt;br /&gt;&lt;ol style=&quot;font-weight: bold;&quot;&gt;&lt;li&gt;Sub &lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;MinimizeQTPWindow&lt;/span&gt; ()&lt;/li&gt;&lt;li&gt;    Set &lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;    qtApp = &lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;getObject&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/span&gt;,&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;QuickTest.Application&quot;&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;    qtApp&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;WindowState &lt;/span&gt;= &lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;&quot;Minimized&quot;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;    Set &lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;qtApp = &lt;/span&gt;Nothing&lt;/li&gt;&lt;li&gt;End Sub&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt; &lt;/div&gt;  &lt;span style=&quot;color: rgb(0, 0, 0); font-weight: normal;&quot; lang=&quot;EN-US&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: normal;&quot;&gt;To minimize QTP window, just execute &lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;MinimizeQTPWindow&lt;/span&gt; () &lt;span style=&quot;color: rgb(0, 0, 0); font-weight: normal;&quot;&gt;procedure:&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;  &lt;div style=&quot;border: 1px dotted rgb(160, 160, 160); margin: 0pt; padding: 0pt; background-color: rgb(240, 240, 240); color: rgb(0, 0, 153); width: 95%; font-family: &#39;Courier New&#39;,Courier,monospace; font-size: 90%;&quot;&gt;&lt;br /&gt;&lt;ol style=&quot;font-weight: bold;&quot;&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;MinimizeQTPWindow&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt; &lt;/div&gt;   &lt;span style=&quot;color: rgb(0, 0, 0); font-weight: normal;&quot; lang=&quot;EN-US&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal; color: rgb(0, 0, 0);&quot;&gt;For detailed information, I recommend to Read &lt;span style=&quot;font-weight: bold;&quot;&gt;QTP Help &amp;gt; QuickTest Automation  Object Model Reference&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-weight: normal; color: rgb(0, 0, 0);&quot;&gt;Since &lt;/span&gt;&lt;span style=&quot;font-weight: normal; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;QuickTest Automation  Object Model &lt;/span&gt;does not use UI, second approach is more stable.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;But first method is more flexible - it allows working with browsers and stand-alone windows. &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;In any case, I recommend to read and explore both approaches.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;a href=&quot;http://motevich.blogspot.com/2007/12/how-to-minimize-qtp-window.html&quot;&gt;Source&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/2933021918773421200/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/how-to-minimizemaximize-qtp-window.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/2933021918773421200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/2933021918773421200'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/how-to-minimizemaximize-qtp-window.html' title='How to minimize/maximize QTP window?'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzlre48r6vz97wcwvQVAvWwrdTL98KuRF22HqlRj0_C-03L8Atf_eIyzgTUxonYU1cEnWHFEyPGJS41p8p-DtJ19GJs8sEQNPRa7z-Jz8UD5RG7eo_bTIl6f4kyii2uWfNNW2Yp-k1KY8/s72-c/01_QTP_window_c.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-1864993973820251984</id><published>2011-04-03T07:08:00.000-07:00</published><updated>2011-04-03T07:08:00.963-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QTP - Scripts"/><title type='text'>How to capture tool tip of link?</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;How to capture a tool tip text in QTP&lt;/span&gt;?&lt;br /&gt;&lt;br /&gt;For example, how to get tool tip (&lt;span style=&quot;font-style: italic;&quot;&gt;&#39;Go to My Yahoo!&#39;&lt;/span&gt;) from the &lt;a href=&quot;http://yahoo.com/&quot;&gt;yahoo page&lt;/a&gt;:&lt;br /&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; border: medium none;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcVpQdiKt74JqL8c8iLlVBBhKltDKTAB4MHk5YgXJOHhaViJ1-cq8-AoEO5EXsvUTg4Ije3nTsZ5ijv_GbcM6R0lAQpCAyV4YZXUOjecBmFRClX3ly812fAFni8ER_JdMy9GEXjHEo27U/&quot; alt=&quot;Tooltip on Yahoo page&quot; /&gt;&lt;br /&gt;This QTP tutorial shows and explains &lt;span style=&quot;font-weight: bold;&quot;&gt;How &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;to get tool tip in QuickTest Professional.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Actually, this is not a difficult task. The steps are:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Place mouse cursor over the link&lt;/li&gt;&lt;li&gt;Wait for tool tip&lt;/li&gt;&lt;li&gt;Get text of shown tool tip&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;This QTP script captures a text of a tool tip:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;htmlcode&quot; style=&quot;border: 1px solid gray; margin: 10pt; padding: 10pt; background-color: rgb(240, 240, 240); font-family: monospace;&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;color: Green;&quot;&gt;&#39; Place mouse cursor over the link&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Browser(&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;Yahoo!&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;).Page(&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;Yahoo!&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;).WebElement(&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;text:=My Yahoo!&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;).FireEvent &lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;onmouseover&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;wait&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;1&lt;/span&gt;&lt;br /&gt;&#39; Grab tooltip&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;ToolTip = Window(&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;nativeclass:=tooltips_class32&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;).GetROProperty(&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;text&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;Please, pay attention on details:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;We use &lt;span style=&quot;color: Green;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;&lt;span&gt;FireEvent&lt;/span&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&quot;onmouseover&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;)&lt;/span&gt; to simulate mouse placing over the link&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: Green;&quot;&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Function &lt;span style=&quot;font-weight: bold;&quot;&gt;wait&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;1&lt;/span&gt;)&lt;/span&gt; waits 1 second for a tool tip&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: Green;&quot;&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;To get tool tip text, we use:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: Green;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Window(&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;nativeclass:=tooltips_class32&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;).GetROProperty(&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;text&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Let&#39;s run our code and compare captured tool tip with expected (&lt;span style=&quot;font-style: italic; color: rgb(0, 0, 0);&quot;&gt;&#39;Go to My Yahoo!&#39;&lt;/span&gt;):&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL3mIMmpPgyQ49ZCh4SvwpHWjgkLEri0irLENMIgOiPIZoVGiGTRvc0LvE1d-F2LEgDcBPvbyozt4tznTVD-iPfM0JOUUxIyfEKGZjAmcJlgSp2WXqN3_oV19ltJC90scdJF2LkYbGP6A/s1600-h/2_result_c.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL3mIMmpPgyQ49ZCh4SvwpHWjgkLEri0irLENMIgOiPIZoVGiGTRvc0LvE1d-F2LEgDcBPvbyozt4tznTVD-iPfM0JOUUxIyfEKGZjAmcJlgSp2WXqN3_oV19ltJC90scdJF2LkYbGP6A/s400/2_result_c.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5201073752418002754&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;As you can see, above &lt;span style=&quot;font-weight: bold;&quot;&gt;QTP script  captures correct text of a Tool tip&lt;/span&gt;.&lt;br /&gt;I hope, you will add this script to your QTP functions library.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.blogger.com/post-create.g?blogID=5531051101500543810&quot;&gt;Source&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/1864993973820251984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/how-to-capture-tool-tip-of-link.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/1864993973820251984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/1864993973820251984'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/how-to-capture-tool-tip-of-link.html' title='How to capture tool tip of link?'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcVpQdiKt74JqL8c8iLlVBBhKltDKTAB4MHk5YgXJOHhaViJ1-cq8-AoEO5EXsvUTg4Ije3nTsZ5ijv_GbcM6R0lAQpCAyV4YZXUOjecBmFRClX3ly812fAFni8ER_JdMy9GEXjHEo27U/s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-8617807276584052829</id><published>2011-04-02T07:11:00.001-07:00</published><updated>2011-04-02T07:11:49.795-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QTP - VBScript"/><title type='text'>VBScript - Are you sure 1+1=2?</title><content type='html'>&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;QTP VBScript&lt;/span&gt; contains different niceties. This article shows that &lt;span style=&quot;font-weight: bold;&quot;&gt;1 + 1&lt;/span&gt; doesn&#39;t equal &lt;span style=&quot;font-weight: bold;&quot;&gt;2&lt;/span&gt; sometimes.&lt;br /&gt;&lt;br /&gt;&lt;table style=&quot;width: 364px; height: 44px; margin-left: auto; margin-right: auto; text-align: left;&quot; border=&quot;1&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;Exactly, &lt;span style=&quot;font-weight: bold;&quot;&gt;1 + 1&lt;/span&gt; doesn&#39;t equal &lt;span style=&quot;font-weight: bold;&quot;&gt;2&lt;/span&gt; sometimes.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;Well, I&#39;ve prepared this &lt;span style=&quot;color: rgb(0, 0, 153); font-weight: bold;&quot;&gt;QTP script&lt;/span&gt;:&lt;br /&gt;&lt;div id=&quot;htmlcode&quot; style=&quot;border: 1px solid gray; margin: 10pt; padding: 10pt; background-color: rgb(240, 240, 240);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;n1 = &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;InputBox&lt;/span&gt;(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;Enter first number&quot;&lt;/span&gt;)&lt;br /&gt;n2 = &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;InputBox&lt;/span&gt;(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;Enter second number&quot;&lt;/span&gt;)&lt;br /&gt;n1increased = n1 + 1&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;If&lt;/span&gt; n1increased = n2 &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Then&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;    MsgBox &lt;/span&gt;n1 &amp;amp; &lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot; + 1 equals &quot;&lt;/span&gt; &amp;amp; n2&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Else&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;    MsgBox&lt;/span&gt; n1 &amp;amp; &lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot; + 1 doesn&#39;t equal &quot;&lt;/span&gt; &amp;amp; n2&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;End If&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;I will explain it step by step and show all entered data and generated result.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Read first number&lt;/span&gt; from user&#39;s input&lt;br /&gt;I enter &lt;span style=&quot;color: rgb(0, 0, 153); font-weight: bold;&quot;&gt;1&lt;/span&gt; as a first number:&lt;br /&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; border: medium none;&quot; src=&quot;http://lh3.ggpht.com/mangazey/SNfhHN4zWAI/AAAAAAAAAzE/bdC-GimX4AY/1_n1_c.gif&quot; alt=&quot;First number = 1&quot; /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Read second number&lt;/span&gt; from user&#39;s input&lt;br /&gt;I enter &lt;span style=&quot;color: rgb(0, 0, 153); font-weight: bold;&quot;&gt;2&lt;/span&gt; as a second number:&lt;br /&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; border: medium none;&quot; src=&quot;http://lh3.ggpht.com/mangazey/SNfhwPvngyI/AAAAAAAAAzM/BDUcb7Q4wKk/2_n2_c.gif&quot; alt=&quot;Second value = 2&quot; /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Increase&lt;/span&gt; first number &lt;span style=&quot;font-weight: bold;&quot;&gt;by 1&lt;/span&gt;&lt;br /&gt;&lt;div id=&quot;htmlcode&quot; style=&quot;border: 1px solid gray; margin: 10pt; padding: 10pt; background-color: rgb(240, 240, 240);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;n1increased = n1 + 1&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Check&lt;/span&gt; whether first increased number &lt;span style=&quot;font-weight: bold;&quot;&gt;equals&lt;/span&gt; to second number&lt;br /&gt;&lt;div id=&quot;htmlcode&quot; style=&quot;border: 1px solid gray; margin: 10pt; padding: 10pt; background-color: rgb(240, 240, 240);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;If&lt;/span&gt; n1increased = n2 &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Then&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;    MsgBox &lt;/span&gt;n1 &amp;amp; &lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot; + 1 equals &quot;&lt;/span&gt; &amp;amp; n2&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Else&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;    MsgBox&lt;/span&gt; n1 &amp;amp; &lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot; + 1 doesn&#39;t equal &quot;&lt;/span&gt; &amp;amp; n2&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;End If&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;And the result is:&lt;br /&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; border: medium none;&quot; src=&quot;http://lh4.ggpht.com/mangazey/SNfionCuD-I/AAAAAAAAAzU/XWsVfi72kG0/3_result.gif&quot; alt=&quot;The result of QTP script&quot; /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Do you know why it is so? What is a reason?&lt;br /&gt;The answer is simple. This is due to &lt;span style=&quot;font-weight: bold;&quot;&gt;converting of VBScript types&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;After  you read first number (1)  from user and assign it (value of course  value, not user :) )  to variable, this variable has value of &lt;span style=&quot;font-weight: bold;&quot;&gt;String&lt;/span&gt; type.&lt;br /&gt;So, this is the same like &lt;span style=&quot;font-weight: bold;&quot;&gt;n1 = &quot;1&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When VBScript executes this line:&lt;br /&gt;&lt;div id=&quot;htmlcode&quot; style=&quot;border: 1px solid gray; margin: 10pt; padding: 10pt; background-color: rgb(240, 240, 240);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;n1increased = n1 + 1&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;it sees, that we perform mathematical operation and &lt;span style=&quot;font-weight: bold;&quot;&gt;converts&lt;/span&gt; n1 into number.&lt;br /&gt;Then VBScript calculates &lt;span style=&quot;font-weight: bold;&quot;&gt;n1 + 1 &lt;/span&gt;&lt;span&gt;a&lt;/span&gt;nd the result (&lt;span style=&quot;font-weight: bold;&quot;&gt;2&lt;/span&gt;) has a numeric type - Double (special double-precision floating-point value).&lt;br /&gt;&lt;br /&gt;Here is the main point! &lt;span style=&quot;font-weight: bold;&quot;&gt;2 as Number&lt;/span&gt; is not the same as &lt;span style=&quot;font-weight: bold;&quot;&gt;2 as String&lt;/span&gt;. These values have &lt;span style=&quot;font-weight: bold;&quot;&gt;different type&lt;/span&gt; and that&#39;s why they differ.&lt;br /&gt;Simple visual example - two apples are not equal to two pears :)&lt;br /&gt;&lt;br /&gt;I can demonstrate the above types converting.&lt;br /&gt;I&#39;ve added this code into our QTP script before if-then-else:&lt;br /&gt;&lt;div id=&quot;htmlcode&quot; style=&quot;border: 1px solid gray; margin: 10pt; padding: 10pt; background-color: rgb(240, 240, 240); font-weight: bold;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;MsgBox&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;TypeName(n1): &quot;&lt;/span&gt; &amp;amp; &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;TypeName&lt;/span&gt;(n1)&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;MsgBox&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;TypeName(n1increased): &quot;&lt;/span&gt; &amp;amp; &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;TypeName&lt;/span&gt;(n1increased)&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;MsgBox&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;TypeName(n2): &quot;&lt;/span&gt; &amp;amp; &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;TypeName&lt;/span&gt;(n2)&lt;br /&gt;&lt;/div&gt;And its result is:&lt;br /&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; border: medium none;&quot; src=&quot;http://lh4.ggpht.com/mangazey/SNf0D_Q1veI/AAAAAAAAAzc/LLwxj4baT2U/4_all.gif&quot; alt=&quot;Results of TypeName&quot; /&gt;That&#39;s why the value of number variable is not equal to the value of string variable.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Well, How to make that 1 + 1 = 2 ?&lt;/span&gt;&lt;br /&gt;Answer: Convert string value to number with &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;CInt&lt;/span&gt; function:&lt;br /&gt;&lt;div id=&quot;htmlcode&quot; style=&quot;border: 1px solid gray; margin: 10pt; padding: 10pt; background-color: rgb(240, 240, 240);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;If&lt;/span&gt; n1increased = &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;CInt&lt;/span&gt;(&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;n2) &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Then&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;    MsgBox &lt;/span&gt;n1 &amp;amp; &lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot; + 1 equals &quot;&lt;/span&gt; &amp;amp; n2&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Else&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;    MsgBox&lt;/span&gt; n1 &amp;amp; &lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot; + 1 doesn&#39;t equal &quot;&lt;/span&gt; &amp;amp; n2&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;End If&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;And the result is:&lt;br /&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; border: medium none;&quot; src=&quot;http://lh4.ggpht.com/mangazey/SNf272Bt6YI/AAAAAAAAAzk/eszLq_Q6l-0/5_correct_result.gif&quot; alt=&quot;Correct result of QTP script&quot; /&gt;It works. It works correctly :)&lt;br /&gt;&lt;br /&gt;I hope, you will keep in mind this issue with VBScript types converting. It can save your time during debugging of QTP scripts.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://motevich.blogspot.com/2008/09/qtp-vbscript-tutorial.html&quot;&gt;Source&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/8617807276584052829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/vbscript-are-you-sure-112.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/8617807276584052829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/8617807276584052829'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/vbscript-are-you-sure-112.html' title='VBScript - Are you sure 1+1=2?'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/mangazey/SNfhHN4zWAI/AAAAAAAAAzE/bdC-GimX4AY/s72-c/1_n1_c.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-5354832304715624461</id><published>2011-04-02T07:07:00.001-07:00</published><updated>2011-04-02T07:07:52.128-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QTP - Scripts"/><title type='text'>Capturing tool tips of images</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;Now, I&#39;m going to show how to show &lt;span style=&quot;font-weight: bold;&quot;&gt;how to capture tool tips of images&lt;/span&gt; located on a Web page.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;Actually, the solution is simple.&lt;br /&gt;To capture a tool tip of an image, we can get value of &lt;span style=&quot;font-weight: bold;&quot;&gt;&quot;alt&quot;&lt;/span&gt; Run-time Object property with &lt;span style=&quot;font-weight: bold; color: Green;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;GetROProperty(&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;alt&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;)&lt;/span&gt;&lt;/span&gt; function:&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;&lt;/span&gt;&lt;div id=&quot;htmlcode&quot; style=&quot;border: 1px solid gray; margin: 10pt; padding: 10pt; background-color: rgb(240, 240, 240); font-family: monospace;&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;color: Green;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Browser(&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;brw&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;).Page(&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;pg&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;).GetROProperty(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;alt&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;Let&#39;s verify this code in practice. For example, let&#39;s check tooltips from &lt;a href=&quot;http://en.wikipedia.org/wiki/Main_Page&quot;&gt;Wikipedia Main page&lt;/a&gt;:&lt;br /&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; border: medium none;&quot; src=&quot;http://lh3.ggpht.com/mangazey/SEKcE-iNOdI/AAAAAAAAAlE/uQhs4ryWj6g/1_initial_tooltip_c.gif&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;I&#39;ve prepared QTP script, which gets all image from this page and checks their tooltips (&quot;alt&quot; property):&lt;br /&gt;&lt;div id=&quot;htmlcode&quot; style=&quot;border: 1px solid gray; margin: 10pt; padding: 10pt; background-color: rgb(240, 240, 240); font-family: monospace;&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;color: Green;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Dim&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; descImage, listImages, attrAltText, attrSrcText&lt;br /&gt;&lt;br /&gt;Browser(&lt;span style=&quot;color: rgb(102, 51, 0);&quot;&gt;&quot;Main Page - Wikipedia,&quot;&lt;/span&gt;).Sync&lt;br /&gt;Browser(&lt;span style=&quot;color: rgb(102, 51, 0);&quot;&gt;&quot;Main Page - Wikipedia,&quot;&lt;/span&gt;).Page(&lt;span style=&quot;color: rgb(102, 51, 0);&quot;&gt;&quot;Main Page - Wikipedia,&quot;&lt;/span&gt;).Sync&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 102);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0); font-style: italic;&quot;&gt;&#39; Create description for all images on a Web page.&lt;br /&gt;&#39; For that we use &quot;html tag&quot; property and its value &quot;IMG&quot;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 102);&quot;&gt;Set&lt;/span&gt; descImage = &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 102);&quot;&gt;Description&lt;/span&gt;.Create&lt;br /&gt;descImage(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;html tag&quot;&lt;/span&gt;).&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 102);&quot;&gt;value&lt;/span&gt; = &lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;IMG&quot;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0); font-style: italic;&quot;&gt;&#39; Get all images which match the above description&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Set&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; listImages = &lt;/span&gt;&lt;/span&gt;Browser(&lt;span style=&quot;color: rgb(102, 51, 0);&quot;&gt;&quot;Main Page - Wikipedia,&quot;&lt;/span&gt;).Page(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;Main Page - Wikipedia,&quot;&lt;/span&gt;).ChildObjects(descImage)&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 102);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0); font-style: italic;&quot;&gt;&#39; Check tool tips of images&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;For&lt;/span&gt; i = &lt;span style=&quot;color: rgb(102, 51, 0);&quot;&gt;0&lt;/span&gt; To listImages.&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;Count&lt;/span&gt; - &lt;span style=&quot;color: rgb(102, 51, 0);&quot;&gt;1&lt;/span&gt;&lt;br /&gt;    attrAltText = listImages(i).GetROProperty(&lt;span style=&quot;color: rgb(102, 51, 0);&quot;&gt;&quot;alt&quot;&lt;/span&gt;)&lt;br /&gt;    attrSrcText = listImages(i).GetROProperty(&lt;span style=&quot;color: rgb(102, 51, 0);&quot;&gt;&quot;src&quot;&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;If&lt;/span&gt; attrAltText &amp;lt;&amp;gt; &lt;span style=&quot;color: rgb(102, 51, 0);&quot;&gt;&quot;&quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 153); font-weight: bold;&quot;&gt;Then&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;MsgBox&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 51, 0);&quot;&gt;&quot;Image src: &quot;&lt;/span&gt; &amp;amp; attrSrcText &amp;amp; &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;vbNewLine&lt;/span&gt; &amp;amp; &lt;span style=&quot;color: rgb(102, 51, 0);&quot;&gt;&quot;Tool tip: &quot;&lt;/span&gt; &amp;amp; attrAltText&lt;br /&gt;    &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;End If&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;When I run this code in QTP, it shows all images containing non-empty tool tip:&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh44w9yWexbrfJRuvySRsU1MKSYWcQTUHNaVFqhIY9oU8dks8-kkSLo1xt9qHuNt01q87eBh3blNtEm3iTKYmfD2Bby1LU_oGROF6samtuUAyttmvVKebUuxZ4G2wEvxttDcK1c6d5ScJA/s1600-h/2_result_c.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh44w9yWexbrfJRuvySRsU1MKSYWcQTUHNaVFqhIY9oU8dks8-kkSLo1xt9qHuNt01q87eBh3blNtEm3iTKYmfD2Bby1LU_oGROF6samtuUAyttmvVKebUuxZ4G2wEvxttDcK1c6d5ScJA/s400/2_result_c.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5206900225051840322&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;(click the image to enlarge it)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The same message boxes will be shown for others images on a Web page.&lt;br /&gt;&lt;br /&gt;So, our solution is simple - &lt;span style=&quot;font-weight: bold;&quot;&gt;use GetROProperty(&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 51, 0); font-weight: bold;&quot;&gt;&quot;alt&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;) function to get tool tip of image&lt;/span&gt;.&lt;br /&gt;As you can see - it works correctly.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://motevich.blogspot.com/2008/06/qtp-tool-tips-for-images.html&quot;&gt;SOURCE&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/5354832304715624461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/capturing-tool-tips-of-images.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/5354832304715624461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/5354832304715624461'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/capturing-tool-tips-of-images.html' title='Capturing tool tips of images'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/mangazey/SEKcE-iNOdI/AAAAAAAAAlE/uQhs4ryWj6g/s72-c/1_initial_tooltip_c.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-4419225955112264578</id><published>2011-04-02T07:04:00.000-07:00</published><updated>2011-04-02T07:06:09.376-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QTP - Scripts"/><title type='text'>How to get current iteration number of QTP script?</title><content type='html'>QTP test can run several iterations.&lt;br /&gt;By default, when you run a test with global QTP Data Table parameters, &lt;span style=&quot;font-weight: bold;&quot;&gt;QuickTest runs the test for each row in the Data Table&lt;/span&gt;, using the parameters you specified.&lt;br /&gt;&lt;br /&gt;For example, the following global QTP Data Table contains 3 rows:&lt;br /&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; border: medium none;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNwcFdwsoj77Iqkcf2JxlZTTRzjyrV8SQBsIMYMoRyAjk-uIfjbSU-g9HaavsQdIRUl4483RRxE0AaVOmCh2ZR9NgAkfYd0NmCTyOUwcKPDeVsDsTeuJllZAXkv9x8wNiOuGIhbOHBB24/s400/1_QTP_DataTable_c.gif&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;The iteration number of QTP test can be specified in &#39;File/Settings.../Test Settings dialog&#39;, &#39;Run&#39; tab:&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; border: medium none;&quot; src=&quot;http://lh5.ggpht.com/mangazey/SG9GlfoQFOI/AAAAAAAAAps/7sQPjgyWwXY/2_TestSettings_c.gif&quot; alt=&quot;&quot; /&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;If we run our QTP test with above settings (global DataTable &amp;amp; &#39;Run&#39; tab), the test will pass 3 iteration.&lt;br /&gt;So, the question is &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;How to determine the current iteration number withing QTP script?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; font-weight: bold;&quot;&gt;Answer:&lt;/span&gt; We can use the value of &quot;TestIteration&quot; environment variable - &lt;span style=&quot;font-weight: bold;&quot;&gt;Environment(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;TestIteration&quot;&lt;/span&gt;)&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;This is a sample QTP script I use to demonstrate &lt;span style=&quot;font-weight: bold;&quot;&gt;Environment(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;TestIteration&quot;&lt;/span&gt;):&lt;/span&gt;&lt;br /&gt;&lt;div id=&quot;htmlcode&quot; style=&quot;border: 1px solid gray; margin: 10pt; padding: 10pt; background-color: rgb(240, 240, 240);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;str = &lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;Current QTP iteration: &quot;&lt;/span&gt; &amp;amp; Environment(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;TestIteration&quot;&lt;/span&gt;) &amp;amp; &lt;span style=&quot;color: rgb(51, 0, 153);&quot;&gt;vbNewLine&lt;/span&gt; &amp;amp; _&lt;br /&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;Param1: &quot;&lt;/span&gt; &amp;amp; DataTable(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;Param1&quot;&lt;/span&gt;, dtGlobalSheet) &amp;amp; &lt;span style=&quot;color: rgb(51, 0, 153);&quot;&gt;vbNewLine&lt;/span&gt; &amp;amp; _&lt;br /&gt;&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;Param2: &quot;&lt;/span&gt; &amp;amp; DataTable(&lt;span style=&quot;color: rgb(102, 51, 51);&quot;&gt;&quot;Param2&quot;&lt;/span&gt;, dtGlobalSheet)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;MsgBox&lt;/span&gt; &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;str&lt;/span&gt;&lt;/div&gt;And the result of above QTP script is:&lt;br /&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; border: medium none;&quot; src=&quot;http://lh3.ggpht.com/mangazey/SG9S9oZhogI/AAAAAAAAAqk/JSh7DySV194/3_Result_Iterations.gif&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;As you can see, QuickTest Professional script works correctly.&lt;br /&gt;You can use this approach to determine &lt;span style=&quot;font-weight: bold;&quot;&gt;the current iteration number of running QTP script&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://motevich.blogspot.com/2008/07/how-to-get-iteration-number-qtp-script.html&quot;&gt;SOURCE&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/4419225955112264578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/how-to-get-current-iteration-number-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/4419225955112264578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/4419225955112264578'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/04/how-to-get-current-iteration-number-of.html' title='How to get current iteration number of QTP script?'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNwcFdwsoj77Iqkcf2JxlZTTRzjyrV8SQBsIMYMoRyAjk-uIfjbSU-g9HaavsQdIRUl4483RRxE0AaVOmCh2ZR9NgAkfYd0NmCTyOUwcKPDeVsDsTeuJllZAXkv9x8wNiOuGIhbOHBB24/s72-c/1_QTP_DataTable_c.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-4370964162363948768</id><published>2011-02-27T17:13:00.000-08:00</published><updated>2011-02-27T17:13:00.921-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Menu"/><title type='text'>Adding a Context Menu to a Tree Region</title><content type='html'>&lt;h3 class=&quot;post-title entry-title&quot;&gt; Adding a Context Menu to a Tree Region &lt;/h3&gt; &lt;div class=&quot;post-header&quot;&gt;  &lt;/div&gt;  &lt;span&gt;&lt;p&gt;One of the nice new features of Application Express is the new tree region. It is based on &lt;a href=&quot;http://www.jstree.com/&quot;&gt;jsTree&lt;/a&gt;  and supports features such as tool-tips. jsTree is the same tree used  for the new tree view of the Application Builder Page Definition page.  That page supports a right click context menu which is missing from the  current version of the Application Express new tree region. With a  little help from &lt;a href=&quot;http://www.inside-oracle-apex.com/&quot;&gt;Patrick&lt;/a&gt;,  I was able to add a context menu to a tree region I was working on for  an update to the Document Library packaged application. The purpose of  this article is to describe how to do this for your tree regions. I will  use the EMP table as a simple example. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;Patrick  wanted me to mention that we may change the implementation of the tree  in the future, so you may have to adjust the JavaScript code listed here  in future versions of Application Express.&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Let&#39;s  start by creating a copy of the emp table, emp2, so you don&#39;t actually  mess with the emp data. Use the SQL Workshop SQL Command Processor and  the code in listing 1 to create emp2.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Code Listing 1&lt;br /&gt;&lt;/h3&gt;&lt;br /&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;create&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;table&lt;/span&gt;&lt;span&gt; emp2 &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;as&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;select&lt;/span&gt;&lt;span&gt; * &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;from&lt;/span&gt;&lt;span&gt; emp  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;/  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;  &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;alter&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;table&lt;/span&gt;&lt;span&gt; emp2 &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;add&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;constraint&lt;/span&gt;&lt;span&gt; emp2_pk &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;primary&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;key&lt;/span&gt;&lt;span&gt; (empno)  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;/  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;  &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;alter&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;table&lt;/span&gt;&lt;span&gt; emp2 &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;add&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;constraint&lt;/span&gt;&lt;span&gt; emp2_fk &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;foreign&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;key&lt;/span&gt;&lt;span&gt; (mgr) &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;references&lt;/span&gt;&lt;span&gt; emp2(empno)  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;/  &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;pre style=&quot;display: none;&quot; class=&quot;sql&quot; name=&quot;code&quot;&gt;&lt;br /&gt;create table emp2 as select * from emp&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;alter table emp2 add constraint emp2_pk primary key (empno)&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;alter table emp2 add constraint emp2_fk foreign key (mgr) references emp2(empno)&lt;br /&gt;/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Create Application and Tree&lt;br /&gt;&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;With  emp2 in place you are ready to create an application. Simply run the  create application wizard and create a form and report on emp2. You will  replace the report on page 1 with a tree region. After the application  is created, edit page 1. Delete the report region and then create a new  tree region specifying the following options:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Display Attributes, Title: &lt;strong&gt;Employees&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Tree Template: &lt;strong&gt;Default&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Table/View: &lt;strong&gt;EMP2&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Confirm that all values are defaulted on the Query step&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Tooltip: &lt;strong&gt;Database Column&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Tooltip Column: &lt;strong&gt;HIREDATE&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p&gt;Run  the page and confirm that your tree appears. When you right click on a  node, you should only see that standard right click options of whatever  browser you are using.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Create Context Menu&lt;br /&gt;&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Now  for the magic! By sprinkling a little JavaScript on the page here and  there, we will get a nice right click context menu. First edit the tree  region and give the region a static ID of EMP2 as in figure 1. We need  this static ID to make it easier to write JavaScript and select this  region with jQuery.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Figure 1&lt;br /&gt;&lt;/h3&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqRe7lz5BFplgueggrCYMrBZWATMyHVKoiqJlHIh2XtLyBc_ryXCfULiNjWO4Z_s6KBHq-ehYL1eviDlnkCq5fjkrXEW4jXebTIGCRdpOnKd-zmw4GzeTNRlp6ySlq2-jdvzlEUmPSFeKb/s1600/staticID.png&quot;&gt;&lt;img style=&quot;width: 400px; height: 160px;&quot; id=&quot;BLOGGER_PHOTO_ID_5516812598332690722&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqRe7lz5BFplgueggrCYMrBZWATMyHVKoiqJlHIh2XtLyBc_ryXCfULiNjWO4Z_s6KBHq-ehYL1eviDlnkCq5fjkrXEW4jXebTIGCRdpOnKd-zmw4GzeTNRlp6ySlq2-jdvzlEUmPSFeKb/s400/staticID.png&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Now  you just need to sprinkle a little JavaScript on the page! Edit the  page definition of page one and add the code in code listing 2 into the  Function and Global Variable Declaration text area and the code in code  listing 3 into the Execute when Page Loads text area.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Code Listing 2&lt;br /&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt; doAction(pNode,pTree,a){  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;  &lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&lt;span&gt; l_action;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;  &lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&lt;span&gt; l_id;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;  &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;  l_id = pNode.attr(&lt;span class=&quot;string&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;  &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;  &lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (a==&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;create&quot;&lt;/span&gt;&lt;span&gt;) { l_action = &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;f?p=&quot;&lt;/span&gt;&lt;span&gt;+$v(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&#39;pFlowId&#39;&lt;/span&gt;&lt;span&gt;)+&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;:2:&quot;&lt;/span&gt;&lt;span&gt;+$v(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&#39;pInstance&#39;&lt;/span&gt;&lt;span&gt;)+&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;:::2:P2_MGR:&quot;&lt;/span&gt;&lt;span&gt;+l_id }  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;  &lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (a==&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;delete&quot;&lt;/span&gt;&lt;span&gt;) { deleteEmp(pNode,l_id); }  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;  &lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (a==&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;edit&quot;&lt;/span&gt;&lt;span&gt;) { l_action = &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;f?p=&quot;&lt;/span&gt;&lt;span&gt;+$v(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&#39;pFlowId&#39;&lt;/span&gt;&lt;span&gt;)+&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;:2:&quot;&lt;/span&gt;&lt;span&gt;+$v(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&#39;pInstance&#39;&lt;/span&gt;&lt;span&gt;)+&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;::::P2_EMPNO:&quot;&lt;/span&gt;&lt;span&gt;+l_id }  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;  &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;  &lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (l_action != &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;null&lt;/span&gt;&lt;span&gt;) {document.location.href=l_action; }  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;}  &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;pre style=&quot;display: none;&quot; class=&quot;javascript&quot; name=&quot;code&quot;&gt;&lt;br /&gt;function doAction(pNode,pTree,a){&lt;br /&gt;var l_action;&lt;br /&gt;var l_id;&lt;br /&gt;&lt;br /&gt;l_id = pNode.attr(&quot;id&quot;);&lt;br /&gt;&lt;br /&gt;if (a==&quot;create&quot;) { l_action = &quot;f?p=&quot;+$v(&#39;pFlowId&#39;)+&quot;:2:&quot;+$v(&#39;pInstance&#39;)+&quot;:::2:P2_MGR:&quot;+l_id }&lt;br /&gt;if (a==&quot;delete&quot;) { deleteEmp(pNode,l_id); }&lt;br /&gt;if (a==&quot;edit&quot;) { l_action = &quot;f?p=&quot;+$v(&#39;pFlowId&#39;)+&quot;:2:&quot;+$v(&#39;pInstance&#39;)+&quot;::::P2_EMPNO:&quot;+l_id }&lt;br /&gt;&lt;br /&gt;if (l_action != null) {document.location.href=l_action; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/h3&gt;&lt;br /&gt;&lt;h3&gt;Code Listing 3&lt;br /&gt;&lt;/h3&gt;&lt;br /&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&lt;span&gt; lTreeContextMenu={  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    items:{create:&lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;&lt;span&gt;,rename:&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;&lt;span&gt;,remove:&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        contextmenu_create:{  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;            label:&lt;span class=&quot;string&quot;&gt;&quot;&lt;strong&gt;Add Employee&lt;/strong&gt;&quot;&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            icon: &lt;span class=&quot;string&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;            visible: &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            action: &lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt;(pNode, pTree){doAction(pNode, pTree, &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;create&quot;&lt;/span&gt;&lt;span&gt;);}  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;        },  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        contextmenu_delete:{  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;            label:&lt;span class=&quot;string&quot;&gt;&quot;&lt;strong&gt;Delete&lt;/strong&gt;&quot;&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            icon: &lt;span class=&quot;string&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;            visible: &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            action: &lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt;(pNode, pTree){doAction(pNode, pTree, &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;delete&quot;&lt;/span&gt;&lt;span&gt;);}  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;        },  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        contextmenu_edit:{  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;            label:&lt;span class=&quot;string&quot;&gt;&quot;&lt;strong&gt;Edit&lt;/strong&gt;&quot;&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            icon: &lt;span class=&quot;string&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;            visible: &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            action: &lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt;(pNode, pTree){doAction(pNode, pTree, &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;edit&quot;&lt;/span&gt;&lt;span&gt;);}  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;        }  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;}};  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;  &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        &lt;span class=&quot;comment&quot;&gt;// use jsTree to render the tree&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;        &lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&lt;span&gt; lTreeSel = apex.jQuery(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;#EMP2&quot;&lt;/span&gt;&lt;span&gt;).find(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;div.tree&quot;&lt;/span&gt;&lt;span&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        &lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&lt;span&gt; lTreeId = lTreeSel.attr(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;        &lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&lt;span&gt; lDataId = lTreeId.replace(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;tree&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        &lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&lt;span&gt; lTreeData = eval(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;l&quot;&lt;/span&gt;&lt;span&gt;+lDataId+&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;Data&quot;&lt;/span&gt;&lt;span&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;        &lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&lt;span&gt; lTree = lTreeSel.tree({  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;          data:{  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;            type:&lt;span class=&quot;string&quot;&gt;&quot;json&quot;&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            async:&lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;            opts:{  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;              &lt;span class=&quot;string&quot;&gt;&quot;static&quot;&lt;/span&gt;&lt;span&gt;:lTreeData,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;              isTreeLoaded:&lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;              method:&lt;span class=&quot;string&quot;&gt;&quot;POST&quot;&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;              url:&lt;span class=&quot;string&quot;&gt;&quot;wwv_flow.show&quot;&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            }  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;          },  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;          root:{  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;            draggable:&lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            valid_children: &lt;span class=&quot;string&quot;&gt;&quot;folder&quot;&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;          },  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;          folder:{  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;            valid_children: &lt;span class=&quot;string&quot;&gt;&quot;file&quot;&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;          },  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;          file:{  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            valid_children: &lt;span class=&quot;string&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span&gt;,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;            max_children: 0,  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;            max_depth:0  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;          },  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;          opened:[&lt;span class=&quot;string&quot;&gt;&quot;7839&quot;&lt;/span&gt;&lt;span&gt;],  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;          plugins:{contextmenu:lTreeContextMenu}  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;          });  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;  &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        $.showTooltip = &lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt;(pEvent) {  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;        &lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&lt;span&gt; lAction = apex.jQuery(pEvent.target).attr(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;tooltip&quot;&lt;/span&gt;&lt;span&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        &lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (lAction &amp;amp;&amp;amp; lAction != &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span&gt;) {  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;            toolTip_enable(pEvent,&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;&lt;span&gt;,apex.jQuery(&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;&lt;span&gt;).attr(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;tooltip&quot;&lt;/span&gt;&lt;span&gt;));  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        }  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;        }; &lt;span class=&quot;comment&quot;&gt;// showTooltip&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;  &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;        &lt;span class=&quot;comment&quot;&gt;// Bind Tooltips for tree nodes&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        apex.jQuery(&lt;span class=&quot;string&quot;&gt;&#39;a[tooltip]&#39;&lt;/span&gt;&lt;span&gt;, lTreeSel).bind(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;mouseover&quot;&lt;/span&gt;&lt;span&gt;, $.showTooltip);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;  &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        &lt;span class=&quot;comment&quot;&gt;// Hack for right click problem on selected node&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;        apex.jQuery(&lt;span class=&quot;string&quot;&gt;&quot;#EMP2&quot;&lt;/span&gt;&lt;span&gt;).find(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;a&quot;&lt;/span&gt;&lt;span&gt;).live(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;mouseup&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt;() {apex.jQuery(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;#EMP2&quot;&lt;/span&gt;&lt;span&gt;).find(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;a&quot;&lt;/span&gt;&lt;span&gt;).removeClass()});  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;pre style=&quot;display: none;&quot; class=&quot;javascript&quot; name=&quot;code&quot;&gt;&lt;br /&gt;var lTreeContextMenu={&lt;br /&gt; items:{create:false,rename:false,remove:false,&lt;br /&gt;     contextmenu_create:{&lt;br /&gt;         label:&quot;&lt;strong&gt;Add Employee&lt;/strong&gt;&quot;,&lt;br /&gt;         icon: &quot;&quot;,&lt;br /&gt;         visible: true,&lt;br /&gt;         action: function(pNode, pTree){doAction(pNode, pTree, &quot;create&quot;);}&lt;br /&gt;     },&lt;br /&gt;     contextmenu_delete:{&lt;br /&gt;         label:&quot;&lt;strong&gt;Delete&lt;/strong&gt;&quot;,&lt;br /&gt;         icon: &quot;&quot;,&lt;br /&gt;         visible: true,&lt;br /&gt;         action: function(pNode, pTree){doAction(pNode, pTree, &quot;delete&quot;);}&lt;br /&gt;     },&lt;br /&gt;     contextmenu_edit:{&lt;br /&gt;         label:&quot;&lt;strong&gt;Edit&lt;/strong&gt;&quot;,&lt;br /&gt;         icon: &quot;&quot;,&lt;br /&gt;         visible: true,&lt;br /&gt;         action: function(pNode, pTree){doAction(pNode, pTree, &quot;edit&quot;);}&lt;br /&gt;     }&lt;br /&gt;}};&lt;br /&gt;&lt;br /&gt;     // use jsTree to render the tree&lt;br /&gt;     var lTreeSel = apex.jQuery(&quot;#EMP2&quot;).find(&quot;div.tree&quot;);&lt;br /&gt;     var lTreeId = lTreeSel.attr(&quot;id&quot;);&lt;br /&gt;     var lDataId = lTreeId.replace(&quot;tree&quot;,&quot;&quot;);&lt;br /&gt;     var lTreeData = eval(&quot;l&quot;+lDataId+&quot;Data&quot;);&lt;br /&gt;     var lTree = lTreeSel.tree({&lt;br /&gt;       data:{&lt;br /&gt;         type:&quot;json&quot;,&lt;br /&gt;         async:true,&lt;br /&gt;         opts:{&lt;br /&gt;           &quot;static&quot;:lTreeData,&lt;br /&gt;           isTreeLoaded:false,&lt;br /&gt;           method:&quot;POST&quot;,&lt;br /&gt;           url:&quot;wwv_flow.show&quot;&lt;br /&gt;         }&lt;br /&gt;       },&lt;br /&gt;       root:{&lt;br /&gt;         draggable:false,&lt;br /&gt;         valid_children: &quot;folder&quot;&lt;br /&gt;       },&lt;br /&gt;       folder:{&lt;br /&gt;         valid_children: &quot;file&quot;&lt;br /&gt;       },&lt;br /&gt;       file:{&lt;br /&gt;         valid_children: &quot;none&quot;,&lt;br /&gt;         max_children: 0,&lt;br /&gt;         max_depth:0&lt;br /&gt;       },&lt;br /&gt;       opened:[&quot;7839&quot;],&lt;br /&gt;       plugins:{contextmenu:lTreeContextMenu}&lt;br /&gt;       });&lt;br /&gt;&lt;br /&gt;     $.showTooltip = function(pEvent) {&lt;br /&gt;     var lAction = apex.jQuery(pEvent.target).attr(&quot;tooltip&quot;);&lt;br /&gt;     if (lAction &amp;amp;&amp;amp; lAction != &quot;&quot;) {&lt;br /&gt;         toolTip_enable(pEvent,this,apex.jQuery(this).attr(&quot;tooltip&quot;));&lt;br /&gt;     }&lt;br /&gt;     }; // showTooltip&lt;br /&gt;&lt;br /&gt;     // Bind Tooltips for tree nodes&lt;br /&gt;     apex.jQuery(&#39;a[tooltip]&#39;, lTreeSel).bind(&quot;mouseover&quot;, $.showTooltip);&lt;br /&gt;&lt;br /&gt;     // Hack for right click problem on selected node&lt;br /&gt;     apex.jQuery(&quot;#EMP2&quot;).find(&quot;a&quot;).live(&quot;mouseup&quot;,function() {apex.jQuery(&quot;#EMP2&quot;).find(&quot;a&quot;).removeClass()});&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now  when you run the page you should see a right click context menu when  you right click on a node in your tree, like figure 2. Note that the Add  Employee and Edit actions are implemented and working. The delete  action is not yet working, that will be added next.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Figure 2&lt;br /&gt;&lt;/h3&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiccGoKKyNOEppFnFSC1HY8nR6QtxnRP6ey3VTv051X9_d_1U25OlDm39zs7oTLGpRzsJ04tmAnxCK_eIdAFQ1BwcDQRPAKy-fOTcn2MPlFkSYvFr1FSgArXJoD2XczBSMzzrE3L0xm68C8/s1600/contextMenu.png&quot;&gt;&lt;img style=&quot;width: 400px; height: 210px;&quot; id=&quot;BLOGGER_PHOTO_ID_5516812605370163138&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiccGoKKyNOEppFnFSC1HY8nR6QtxnRP6ey3VTv051X9_d_1U25OlDm39zs7oTLGpRzsJ04tmAnxCK_eIdAFQ1BwcDQRPAKy-fOTcn2MPlFkSYvFr1FSgArXJoD2XczBSMzzrE3L0xm68C8/s400/contextMenu.png&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Implement Delete Action&lt;br /&gt;&lt;/h2&gt;&lt;br /&gt;Technically  the delete action is already implemented. You could edit the employee  and just click delete on the next page. What sounds like more fun is to  call an on demand process using AJAX from some JavaScript, and then use  jQuery to remove the node from the tree, display a confirmation message,  all without doing a page submit. First things first though, create a  region that will hold the message specifying the following options:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Region Type: &lt;strong&gt;HTML&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Title: &lt;strong&gt;Message Container&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Region Template: &lt;strong&gt;No Template&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Sequence: &lt;strong&gt;5&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Region Source: See Code Listing 4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;h3&gt;Code Listing 4&lt;br /&gt;&lt;/h3&gt;&lt;br /&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-xml&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;div&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;success&quot;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;success-message&quot;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;style&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;display:none;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&gt;&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;  &lt;span class=&quot;tag&quot;&gt;&lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;img&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;src&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;#IMAGE_PREFIX#delete.gif&quot;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;onclick&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;apex.jQuery(&#39;#success-message&#39;).hide()&quot;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;style&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;float:right;&quot;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;remove-message&quot;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;alt&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&gt;&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;div&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;attribute-value&quot;&gt;&quot;theMessage&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&gt;&lt;/span&gt;&lt;span&gt;This is a placeholder for messages&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;!--&lt;/span--&gt;&lt;span class=&quot;tag-name&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&gt;&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;!--&lt;/span--&gt;&lt;span class=&quot;tag-name&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&gt;&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;pre style=&quot;display: none;&quot; class=&quot;html&quot; name=&quot;code&quot;&gt;&lt;br /&gt;&lt;div class=&quot;success&quot; id=&quot;success-message&quot; style=&quot;display: none;&quot;&gt;&lt;br /&gt;&lt;img src=&quot;http://www.blogger.com/post-create.do#IMAGE_PREFIX#delete.gif&quot; onclick=&quot;apex.jQuery(&#39;#success-message&#39;).hide()&quot; style=&quot;float: right;&quot; class=&quot;remove-message&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;&lt;div id=&quot;theMessage&quot;&gt;This is a placeholder for messages&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now we have a place for messages. Next, create a process on page 1 with the following options:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Process Type: &lt;strong&gt;PL/SQL&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Name: &lt;strong&gt;DELETE_EMPLOYEE&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Point: &lt;strong&gt;On Demand – Run this process when requested by AJAX&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;PL/SQL Page Process: See Code Listing 5&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;h3&gt;Code Listing 5&lt;br /&gt;&lt;/h3&gt;&lt;br /&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;begin&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    &lt;span class=&quot;keyword&quot;&gt;delete&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;from&lt;/span&gt;&lt;span&gt; emp2 &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;where&lt;/span&gt;&lt;span&gt; empno = apex_application.g_x01;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    owa_util.mime_header(&lt;span class=&quot;string&quot;&gt;&#39;text/xml&#39;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;FALSE&lt;/span&gt;&lt;span&gt; );  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    htp.p(&lt;span class=&quot;string&quot;&gt;&#39;Cache-Control: no-cache&#39;&lt;/span&gt;&lt;span&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    htp.p(&lt;span class=&quot;string&quot;&gt;&#39;Pragma: no-cache&#39;&lt;/span&gt;&lt;span&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    owa_util.http_header_close;  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    htp.p(&lt;span class=&quot;string&quot;&gt;&#39;{result:&quot;success&quot;,message:&quot;Employee successfully deleted&quot;}&#39;&lt;/span&gt;&lt;span&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;exception &lt;span class=&quot;keyword&quot;&gt;when&lt;/span&gt;&lt;span&gt; others &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;then&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    owa_util.mime_header(&lt;span class=&quot;string&quot;&gt;&#39;text/xml&#39;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;FALSE&lt;/span&gt;&lt;span&gt; );  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    htp.p(&lt;span class=&quot;string&quot;&gt;&#39;Cache-Control: no-cache&#39;&lt;/span&gt;&lt;span&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    htp.p(&lt;span class=&quot;string&quot;&gt;&#39;Pragma: no-cache&#39;&lt;/span&gt;&lt;span&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    owa_util.http_header_close;  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    htp.p(&lt;span class=&quot;string&quot;&gt;&#39;{result:&quot;failed&quot;,message:&quot;Error deleting employee: &#39;&lt;/span&gt;&lt;span&gt;||sqlerrm||&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&#39;&quot;}&#39;&lt;/span&gt;&lt;span&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;end&lt;/span&gt;&lt;span&gt;;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;pre style=&quot;display: none;&quot; class=&quot;sql&quot; name=&quot;code&quot;&gt;&lt;br /&gt;begin&lt;br /&gt; delete from emp2 where empno = apex_application.g_x01;&lt;br /&gt; owa_util.mime_header(&#39;text/xml&#39;, FALSE );&lt;br /&gt; htp.p(&#39;Cache-Control: no-cache&#39;);&lt;br /&gt; htp.p(&#39;Pragma: no-cache&#39;);&lt;br /&gt; owa_util.http_header_close;&lt;br /&gt; htp.p(&#39;{result:&quot;success&quot;,message:&quot;Employee successfully deleted&quot;}&#39;);&lt;br /&gt;exception when others then&lt;br /&gt; owa_util.mime_header(&#39;text/xml&#39;, FALSE );&lt;br /&gt; htp.p(&#39;Cache-Control: no-cache&#39;);&lt;br /&gt; htp.p(&#39;Pragma: no-cache&#39;);&lt;br /&gt; owa_util.http_header_close;&lt;br /&gt; htp.p(&#39;{result:&quot;failed&quot;,message:&quot;Error deleting employee: &#39;||sqlerrm||&#39;&quot;}&#39;);&lt;br /&gt;end;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Finally,  you add the JavaScript to do the AJAX call, display the result message,  and remove the node from the tree. Edit the page attributes and add the  code in code listing 6 in the Function and Global Variable Declaration  text area before the existing doAction function.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Code Listing 6&lt;br /&gt;&lt;/h3&gt;&lt;br /&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt; confirmSubmit(){  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&lt;span&gt; agree=confirm(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;Are you sure you wish to continue and delete?&quot;&lt;/span&gt;&lt;span&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (agree)  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt; &lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;&lt;span&gt; ;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt; &lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;&lt;span&gt; ;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;}  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;  &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt; deleteEmp(pNode,pId){  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;  &lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&lt;span&gt; lTest = confirmSubmit();  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;  &lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (lTest) {  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    &lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&lt;span&gt; get = &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt;&lt;span&gt; htmldb_Get(&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;null&lt;/span&gt;&lt;span&gt;,$v(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&#39;pFlowId&#39;&lt;/span&gt;&lt;span&gt;),&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&#39;APPLICATION_PROCESS=DELETE_EMPLOYEE&#39;&lt;/span&gt;&lt;span&gt;,$v(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&#39;pFlowStepId&#39;&lt;/span&gt;&lt;span&gt;));  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    get.addParam(&lt;span class=&quot;string&quot;&gt;&#39;x01&#39;&lt;/span&gt;&lt;span&gt;,pId);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    gReturn = get.get();  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    &lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&lt;span&gt; j = eval(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;(&quot;&lt;/span&gt;&lt;span&gt;+gReturn+&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;)&quot;&lt;/span&gt;&lt;span&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    apex.jQuery(&lt;span class=&quot;string&quot;&gt;&quot;#theMessage&quot;&lt;/span&gt;&lt;span&gt;).text(j.message);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    apex.jQuery(&lt;span class=&quot;string&quot;&gt;&quot;#success-message&quot;&lt;/span&gt;&lt;span&gt;).show();  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    &lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt; (j.result == &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;success&quot;&lt;/span&gt;&lt;span&gt;) {  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;        pNode.remove();  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    }  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;  &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    get = &lt;span class=&quot;keyword&quot;&gt;null&lt;/span&gt;&lt;span&gt;;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;  }  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;}  &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;pre style=&quot;display: none;&quot; class=&quot;javascript&quot; name=&quot;code&quot;&gt;&lt;br /&gt;function confirmSubmit(){&lt;br /&gt;var agree=confirm(&quot;Are you sure you wish to continue and delete?&quot;);&lt;br /&gt;if (agree)&lt;br /&gt;return true ;&lt;br /&gt;else&lt;br /&gt;return false ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function deleteEmp(pNode,pId){&lt;br /&gt;var lTest = confirmSubmit();&lt;br /&gt;if (lTest) {&lt;br /&gt; var get = new htmldb_Get(null,$v(&#39;pFlowId&#39;),&#39;APPLICATION_PROCESS=DELETE_EMPLOYEE&#39;,$v(&#39;pFlowStepId&#39;));&lt;br /&gt; get.addParam(&#39;x01&#39;,pId);&lt;br /&gt; gReturn = get.get();&lt;br /&gt; var j = eval(&quot;(&quot;+gReturn+&quot;)&quot;);&lt;br /&gt; apex.jQuery(&quot;#theMessage&quot;).text(j.message);&lt;br /&gt; apex.jQuery(&quot;#success-message&quot;).show();&lt;br /&gt; if (j.result == &quot;success&quot;) {&lt;br /&gt;     pNode.remove();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; get = null;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now  run the page and unroll Clark. Right click on Miller and choose delete.  Confirm the delete and the result should be similar to figure 3.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Figure 3&lt;br /&gt;&lt;/h3&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7ZGOVAew6AyAWrzSFxZWcZHeJp5yLYB0-nvBhcWOU88LFgjrkNUe3ip-qn5jIzHaY-MSwrDb93hZl4OW4cyG-AN7WlqsipcWhnukv7HabAyZHfxPQ1KLx1mmMLE4cjpCnlgDsxxIALUKj/s1600/delete.png&quot;&gt;&lt;img style=&quot;width: 400px; height: 339px;&quot; id=&quot;BLOGGER_PHOTO_ID_5516812612563742018&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7ZGOVAew6AyAWrzSFxZWcZHeJp5yLYB0-nvBhcWOU88LFgjrkNUe3ip-qn5jIzHaY-MSwrDb93hZl4OW4cyG-AN7WlqsipcWhnukv7HabAyZHfxPQ1KLx1mmMLE4cjpCnlgDsxxIALUKj/s400/delete.png&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://jastraub.blogspot.com/2010/09/adding-context-menu-to-tree-region.html&quot;&gt;SOURCE&lt;/a&gt;&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/4370964162363948768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/adding-context-menu-to-tree-region.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/4370964162363948768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/4370964162363948768'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/adding-context-menu-to-tree-region.html' title='Adding a Context Menu to a Tree Region'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqRe7lz5BFplgueggrCYMrBZWATMyHVKoiqJlHIh2XtLyBc_ryXCfULiNjWO4Z_s6KBHq-ehYL1eviDlnkCq5fjkrXEW4jXebTIGCRdpOnKd-zmw4GzeTNRlp6ySlq2-jdvzlEUmPSFeKb/s72-c/staticID.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-716624353778557201</id><published>2011-02-26T17:11:00.000-08:00</published><updated>2011-02-26T17:11:00.229-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="White Papers"/><title type='text'>Building an Amazon S3 Client with Application Express 4.0</title><content type='html'>Oracle Application Express (APEX), a feature of the Oracle Database 11g, combines rapid web application development with the power of the Oracle database. Application Builder features an easy-to-use browser-based interface which enables developers and non-programmers to develop and deploy data driven web applications in very little time.&lt;br /&gt;&lt;br /&gt;Oracle Application Express doesn’t depend on any client software for developing or deploying web applications. Simple architecture, and browser-based features make the transition for developers and end-users seamless- simply provide the URL for the cloud environment.&lt;br /&gt;The multi-tenant capabilities of Oracle Application Express allow multiple users and their associated applications to co-exist within one Oracle Database, minimizing cost. Only one instance is needed and users work in a dedicated work area called a workspace. An added advantage, when you create a database backup you also create backup of application source. Oracle Application Express can integrate with other applications by consuming web services.&lt;br /&gt;Amazon Simple Storage Service (Amazon S3) provides highly available and highly scalable Internet storage. It was designed to sustain the concurrent loss of data in two facilities.2 Common use cases include content storage and distribution as well as backup and disaster recovery. Amazon S3 allows for storing objects (files) in containers called buckets and has web service API’s to allow for S3 interactions.&lt;br /&gt;&lt;br /&gt;Oracle Application Express 4.0 introduces support for consuming RESTful web services. RESTful web services conform to a simpler architecture than traditional SOAP based web services. Oracle APEX 4.0’s support for consuming RESTful web services makes it possible to build a client on Amazon S3, using its RESTful web service API.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.oracle.com/technetwork/developer-tools/apex/application-express/building-amazon-s3-with-apex4-209756.pdf&quot;&gt;FULL DOCUMENT&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/716624353778557201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/building-amazon-s3-client-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/716624353778557201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/716624353778557201'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/building-amazon-s3-client-with.html' title='Building an Amazon S3 Client with Application Express 4.0'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-6452937905616663297</id><published>2011-02-25T17:23:00.000-08:00</published><updated>2011-02-25T17:24:05.677-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Interactive Reports"/><title type='text'>Where Did My Saved Interactive Reports Go?</title><content type='html'>Where Did My Saved Interactive Reports Go?&lt;br /&gt;&lt;br /&gt;A problem I&#39;ve seen reported numerous times from customers is that users&#39; saved (or customized) interactive reports are missing after they import a new version of their application. This is a problem we&#39;ve known about for a while with no adequate remedy. However, given the introduction of the APEX_APPLICATION_INSTALL API in Application Express 4.0, I can offer a solution. Granted, it&#39;s not an ideal answer but it&#39;s certainly a feasible and supported solution. Firstly, some explanations are in order.&lt;br /&gt;&lt;br /&gt;When an APEX application is imported into a workspace, the very first thing that&#39;s done is the existing version of the application is completely deleted. All of the meta data associated with the application is deleted - the definition of the pages, the reports on the pages, the templates, the buttons, the branches, the shared components, everything - it&#39;s all deleted. Once this is complete, then the application meta data of the APEX application being imported is then inserted. This whole process is atomic - so if an error occurs, the transaction is rolled back and the net effect is no change.&lt;br /&gt;&lt;br /&gt;In the case of saved Interactive Reports, it&#39;s a little bit different. Imagine you have a production instance running application 645 - you have numerous users who have saved many Customized Interactive Reports. Upon import of a new version of the application, all meta data associated with application 645 is first deleted except the Customized Interactive Reports. In essence, these are left &quot;dangling&quot; until the new application 645 is installed. Once the application import is complete, then the meta data of the Customized Interactive Reports will reference real interactive report definitions again.&lt;br /&gt;&lt;br /&gt;But there&#39;s a catch. If the application ID changes upon import, then this results in totally new meta data IDs being generated. (This is done in an attempt to prevent collisions of meta data, so you can freely export your application and give to anyone in the world to use on their own APEX instance). A meta data offset number is randomly generated and added to all of the existing IDs. This is done uniformly across all of the application meta data (this is important, and you&#39;ll see why shortly). Since the IDs of all of the application meta data have changed, all of your users&#39; customized reports in the previous version of the application are forever left orphaned until they&#39;re cleaned up by an internal APEX batch process. Yikes!&lt;br /&gt;&lt;br /&gt;Let&#39;s look at an example. On apex.oracle.com, I created a simple application with an Interactive Report on the EMP table. I defined this application as application 70000. I then exported this application and imported it back as application 70001.&lt;br /&gt;&lt;br /&gt;Using SQL Commands and the APEX Data Dictionary views, I ran the following queries:&lt;br /&gt;&lt;br /&gt;view plaincopy to clipboardprint?&lt;br /&gt;&lt;br /&gt;   1. select tab_label, tab_id  &lt;br /&gt;   2. from APEX_APPLICATION_TABS  &lt;br /&gt;   3. where application_id = 70000  &lt;br /&gt;   4.   &lt;br /&gt;   5. tab_label: Emp  &lt;br /&gt;   6. tab_id: 1573281607527253166  &lt;br /&gt;   7.   &lt;br /&gt;   8.   &lt;br /&gt;   9. select tab_label, tab_id  &lt;br /&gt;  10. from APEX_APPLICATION_TABS  &lt;br /&gt;  11. where application_id = 70001  &lt;br /&gt;  12.   &lt;br /&gt;  13. tab_label: Emp  &lt;br /&gt;  14. tab_id: 3146580610985521585  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select tab_label, tab_id&lt;br /&gt;from APEX_APPLICATION_TABS&lt;br /&gt;where application_id = 70000&lt;br /&gt;&lt;br /&gt;tab_label: Emp&lt;br /&gt;tab_id: 1573281607527253166&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select tab_label, tab_id&lt;br /&gt;from APEX_APPLICATION_TABS&lt;br /&gt;where application_id = 70001&lt;br /&gt;&lt;br /&gt;tab_label: Emp&lt;br /&gt;tab_id: 3146580610985521585&lt;br /&gt;And the difference between the two IDs is 3146580610985521585 - 1573281607527253166 = 1573299003458268419&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Let&#39;s do this again, but this time, for the APEX data dictionary view for page templates:&lt;br /&gt;view plaincopy to clipboardprint?&lt;br /&gt;&lt;br /&gt;   1. select template_id from APEX_APPLICATION_TEMP_PAGE where template_name = &#39;Login&#39; and application_id = 70000  &lt;br /&gt;   2.   &lt;br /&gt;   3. template_id:  1573270610302252883  &lt;br /&gt;   4.   &lt;br /&gt;   5.   &lt;br /&gt;   6. select template_id from APEX_APPLICATION_TEMP_PAGE where template_name = &#39;Login&#39; and application_id = 70001  &lt;br /&gt;   7.   &lt;br /&gt;   8. template_id:  3146569613760521302  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select template_id from APEX_APPLICATION_TEMP_PAGE where template_name = &#39;Login&#39; and application_id = 70000&lt;br /&gt;&lt;br /&gt;template_id: 1573270610302252883&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select template_id from APEX_APPLICATION_TEMP_PAGE where template_name = &#39;Login&#39; and application_id = 70001&lt;br /&gt;&lt;br /&gt;template_id: 3146569613760521302&lt;br /&gt;&lt;br /&gt;If we once again compute the differences between these two IDs, we get: 3146569613760521302 - 1573270610302252883 = 1573299003458268419&lt;br /&gt;&lt;br /&gt;This happens to be exactly the difference between the IDs of all of the application meta data, with the exception of the application and page IDs. All of the meta data is consistently &quot;pushed&quot; or offset to a new value.&lt;br /&gt;&lt;br /&gt;How is this relevant to missing saved Interactive Reports? Simple. Since we&#39;re able to compute the offset which was used between the two applications, if we had a way to ensure that the same offset is used every time upon application import, then there would be no issue with the old saved Interactive Report IDs matching with the newly imported meta data. They would be married again. And how is this done? In Application Express 4.0, there is a new API named APEX_APPLICATION_INSTALL which enables you to control this offset value.&lt;br /&gt;&lt;br /&gt;To ensure that I didn&#39;t lose the saved Interactive Reports on subsequent imports of application 70000 to application 70001, I included the computed offset before importing this application via SQL*Plus:&lt;br /&gt;&lt;br /&gt;view plaincopy to clipboardprint?&lt;br /&gt;&lt;br /&gt;   1. begin      &lt;br /&gt;   2.     apex_application_install.set_application_id( p_application_id =&gt; 70001 );  &lt;br /&gt;   3.     apex_application_install.set_offset( p_offset =&gt; 1573299003458268419 );  &lt;br /&gt;   4.     --  &lt;br /&gt;   5.     -- set the alias so it doesn&#39;t collide with the alias from app 70000  &lt;br /&gt;   6.     --  &lt;br /&gt;   7.     apex_application_install.set_application_alias(   &lt;br /&gt;   8.         &#39;F&#39; || apex_application.get_application_id );    &lt;br /&gt;   9. end;  &lt;br /&gt;  10. /  &lt;br /&gt;  11.   &lt;br /&gt;  12.   &lt;br /&gt;  13. @f70000.sql  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;begin &lt;br /&gt; apex_application_install.set_application_id( p_application_id =&gt; 70001 );&lt;br /&gt; apex_application_install.set_offset( p_offset =&gt; 1573299003458268419 );&lt;br /&gt; --&lt;br /&gt; -- set the alias so it doesn&#39;t collide with the alias from app 70000&lt;br /&gt; --&lt;br /&gt; apex_application_install.set_application_alias( &lt;br /&gt; &#39;F&#39; || apex_application.get_application_id ); &lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;@f70000.sql&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;That&#39;s all there is to it. Note that I didn&#39;t have to call apex_application_install.set_workspace_id above, because application 70000 and 70001 are in the same workspace where I performed this test.&lt;br /&gt;&lt;br /&gt;As I stated earlier, this isn&#39;t the most elegant solution on the planet and most people don&#39;t want or need to know about meta data IDs or offsets or any of this complexity. But for those experienced users who are stuck with this problem of losing saved interactive reports when migrating from one application ID to another or across workspaces or instances, this is a supported and feasible solution.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://joelkallman.blogspot.com/2010/07/where-did-my-saved-interactive-reports.html&quot;&gt;SOURCE&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/6452937905616663297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/where-did-my-saved-interactive-reports.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/6452937905616663297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/6452937905616663297'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/where-did-my-saved-interactive-reports.html' title='Where Did My Saved Interactive Reports Go?'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-3345295856660224619</id><published>2011-02-25T17:22:00.001-08:00</published><updated>2011-02-25T17:22:52.403-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Network ACLs"/><title type='text'>Application Express, Network ACLs and Oracle Database 11gR2</title><content type='html'>Application Express, Network ACLs and Oracle Database 11gR2&lt;br /&gt;&lt;br /&gt;In Oracle Database 11gR1, a new feature was introduced called Fine-Grained Access to External Network Services. Succinctly defined, this feature gives an administrator control over which database users are permitted to access external network services, and on which ports. If an application relied upon the PL/SQL packages UTL_TCP, UTL_SMTP, UTL_MAIL, UTL_HTTP or UTL_INADDR, they would now need to be given permission to access the external network service via a Network ACL. An excellent writeup of this feature is on ORACLE-BASE.&lt;br /&gt;&lt;br /&gt;There have been two changes in this feature in Database 11gR2 which may impact Application Express users. These aren&#39;t necessarily documented so prominently in the release notes or README of Database 11gR2, so I felt it necessary to share them here.&lt;br /&gt;&lt;br /&gt;   1. In Database 11gR2 11.2.0.1, the precedence order in evaluation of the network ACL entries has been changed to most specific to least specific. More about this below.&lt;br /&gt;&lt;br /&gt;   2. In Database 11gR2 11.2.0.2, the network ACL now applies to any use of DBMS_LDAP.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the installation guide for Oracle Application Express, we document this feature in Oracle Database 11gR1 and also how to create a network access control list which permits the APEX engine to access any network service on any network port. The name of the ACL in our example is power_users.xml. It just so happened that someone else on our instance of Application Express needed access to an outbound HTTP proxy, so I created a separate network ACL for this user.&lt;br /&gt;&lt;br /&gt;The Network ACL privileges looked like:&lt;br /&gt;&lt;br /&gt;view plaincopy to clipboardprint?&lt;br /&gt;&lt;br /&gt;   1. SQL&gt; column host format a30  &lt;br /&gt;   2. SQL&gt; column acl format a40  &lt;br /&gt;   3. SQL&gt; select host, lower_port, upper_port, acl from dba_network_acls;  &lt;br /&gt;   4.   &lt;br /&gt;   5. HOST                           LOWER_PORT UPPER_PORT ACL  &lt;br /&gt;   6. ------------------------------ ---------- ---------- ------------------------------------  &lt;br /&gt;   7. proxyserver.domain.com          80         80        /sys/acls/proxy_rule.xml  &lt;br /&gt;   8. *                                                    /sys/acls/power_users.xml  &lt;br /&gt;   9.   &lt;br /&gt;  10.   &lt;br /&gt;  11. SQL&gt; column acl format a40  &lt;br /&gt;  12. SQL&gt; column principal format a30  &lt;br /&gt;  13. SQL&gt; select acl, principal from dba_network_acl_privileges;  &lt;br /&gt;  14.   &lt;br /&gt;  15. ACL                                      PRINCIPAL  &lt;br /&gt;  16. ---------------------------------------- ------------------------------  &lt;br /&gt;  17. /sys/acls/proxy_rule.xml                 SOME_OTHER_USER  &lt;br /&gt;  18. /sys/acls/power_users.xml                APEX_040000  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; column host format a30&lt;br /&gt;SQL&gt; column acl format a40&lt;br /&gt;SQL&gt; select host, lower_port, upper_port, acl from dba_network_acls;&lt;br /&gt;&lt;br /&gt;HOST LOWER_PORT UPPER_PORT ACL&lt;br /&gt;------------------------------ ---------- ---------- ------------------------------------&lt;br /&gt;proxyserver.domain.com 80 80 /sys/acls/proxy_rule.xml&lt;br /&gt;* /sys/acls/power_users.xml&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; column acl format a40&lt;br /&gt;SQL&gt; column principal format a30&lt;br /&gt;SQL&gt; select acl, principal from dba_network_acl_privileges;&lt;br /&gt;&lt;br /&gt;ACL PRINCIPAL&lt;br /&gt;---------------------------------------- ------------------------------&lt;br /&gt;/sys/acls/proxy_rule.xml SOME_OTHER_USER&lt;br /&gt;/sys/acls/power_users.xml APEX_040000&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Prior to 11.2.0.1, if APEX_040000 needed to access the outbound HTTP proxy, this would be evaluated in terms of the least specific rule to the most specific rule. The ACL power_users.xml permitted access to all hosts on all ports, and thus, there were no issues. But in 11.2.0.1 and higher, this is now evaluated from most specific to least specific. If APEX_040000 now needs to access the outbound HTTP proxy, it is blocked and we&#39;ll encounter the dreaded error message &quot;ORA-24247: network access denied by access control list (ACL)&quot;. A match for the host in the outbound HTTP proxy is found in /sys/acls/proxy_rule.xml, APEX_040000 does not have privileges on that ACL, and now the fine-grained access control blocks the request.&lt;br /&gt;&lt;br /&gt;To correct this, I had to grant privilege on the proxy ACL to APEX_040000:&lt;br /&gt;&lt;br /&gt;view plaincopy to clipboardprint?&lt;br /&gt;&lt;br /&gt;   1. dbms_network_acl_admin.add_privilege(  &lt;br /&gt;   2.     acl =&gt; &#39;proxy_rule.xml&#39;,  &lt;br /&gt;   3.     principal =&gt; &#39;APEX_040000&#39;,  &lt;br /&gt;   4.     is_grant =&gt; TRUE,  &lt;br /&gt;   5.     privilege =&gt; &#39;connect&#39; );  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt; dbms_network_acl_admin.add_privilege(&lt;br /&gt; acl =&gt; &#39;proxy_rule.xml&#39;,&lt;br /&gt; principal =&gt; &#39;APEX_040000&#39;,&lt;br /&gt; is_grant =&gt; TRUE,&lt;br /&gt; privilege =&gt; &#39;connect&#39; );&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To address the second point, in 11.2.0.2, access to the host and port specified by methods in the DBMS_LDAP PL/SQL package are now controlled via this same fine-grained access control to external network services.&lt;br /&gt;&lt;br /&gt;I can understand, from a security perspective, why this behavior was changed. However, if you&#39;ve come to rely upon this behavior, upgrading to Oracle Database 11gR2 may introduce some changed behavior when accessing external network resources.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://joelkallman.blogspot.com/2010/10/application-express-network-acls-and.html&quot;&gt;SOURCE&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/3345295856660224619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/application-express-network-acls-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/3345295856660224619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/3345295856660224619'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/application-express-network-acls-and.html' title='Application Express, Network ACLs and Oracle Database 11gR2'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-5023953010999080494</id><published>2011-02-25T17:20:00.001-08:00</published><updated>2011-02-25T17:20:55.354-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Web Services"/><title type='text'>APEX 4.0 Web Services Evaluation Guide</title><content type='html'>APEX 4.0 Web Services Evaluation Guide&lt;br /&gt;&lt;br /&gt;Application Express 4.0 will offer a number of improved and new Web services features including support for RESTful style Web services both from the consumer and provider perspective. This guide will explain these features and give you step by step instructions on how to use them.&lt;br /&gt;&lt;br /&gt;Note: The instructions below are written assuming that you are using the classic version of page editing and not the Tree view. Also, some exercises will not work properly with Internet Explorer. You should use a browser that is supported for the evaluation such as Firefox.&lt;br /&gt;&lt;br /&gt;Consuming RESTful Style Web Services&lt;br /&gt;&lt;br /&gt;REST (REpresentational State Transfer) is a simpler architecture for accessing Web services than traditional SOAP style Web services. Parameters to a RESTful style Web service are typically passed as part of the URI and the operation is usually described by the HTTP method used: GET, HEAD, POST, PUT, DELETE). Responses are typically in XML or JSON. Application Express 4.0 provides a declarative wizard based method for creating references to RESTful style Web services. Once a reference is created, there are facilities to test calling the Web service as well as wizards to create forms to call the Web service within Application Express and reports to report on the result.&lt;br /&gt;Consuming a RESTful Style Web Service with an XML Response&lt;br /&gt;In this exercise you create a reference to the Yahoo Maps RESTful Web service and then create a form and report to interact with the service. The response returned is XML. You will need to sign up for a Yahoo developer key here.&lt;br /&gt;1. Navigate to the Application Builder home page and click on an application or create a new one.&lt;br /&gt;2. Click Shared Components.&lt;br /&gt;3. Click Web Service References.&lt;br /&gt;4. Click Create &gt;.&lt;br /&gt;5. Choose REST and click Next &gt;.&lt;br /&gt;6. Open https://developer.yahoo.com/maps/rest/V1/ in a new tab or new browser session. You will continue to create the reference to this Web service by reviewing its documentation.&lt;br /&gt;7. Return to Application Express and enter Yahoo Map in the Name field.&lt;br /&gt;8. Enter http://local.yahooapis.com/MapsService/V1/mapImage in the URL field.&lt;br /&gt;9. Click Next &gt;.&lt;br /&gt;10. Enter appid in the Name field and click Add Parameter.&lt;br /&gt;11. Enter location in the Name field and click Next &gt;.&lt;br /&gt;12. Leave Output Format as XML.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex40webservicesevaluationguide-214504.pdf&quot;&gt;COMPLETE DOCUMENT&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/5023953010999080494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/apex-40-web-services-evaluation-guide.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/5023953010999080494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/5023953010999080494'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/apex-40-web-services-evaluation-guide.html' title='APEX 4.0 Web Services Evaluation Guide'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-4686210520627919614</id><published>2011-02-25T17:06:00.000-08:00</published><updated>2011-02-25T17:09:08.775-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Application Express 4.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Time Zones"/><title type='text'>Automatic Time Zone support in Application Express 4.0</title><content type='html'>&lt;h3 class=&quot;post-title entry-title&quot;&gt; Automatic Time Zone support in Application Express 4.0 &lt;/h3&gt; &lt;div class=&quot;post-header&quot;&gt;  &lt;/div&gt;  A feature of &lt;a href=&quot;http://apex.oracle.com/&quot;&gt;Application Express 4.0&lt;/a&gt; which hasn&#39;t received a lot of press but is useful for those building applications that span time zones is the &lt;a href=&quot;http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/bldr.htm#CHDBHCBB&quot;&gt;Automatic Time Zone&lt;/a&gt; application attribute.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The Oracle database has this wonderfully rich data type called &lt;a href=&quot;http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/sql_elements001.htm#sthref163&quot;&gt;TIMESTAMP WITH LOCAL TIME ZONE&lt;/a&gt;.   The elegance of this data type is that the value stored in this column  will be displayed in the user&#39;s current database session time zone.   Having &lt;a href=&quot;http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:5011677391274#tom8218209147129&quot;&gt;written a PL/SQL package&lt;/a&gt;  to do time zone conversion, it is a non-trival exercise to develop this  type of functionality let alone maintain it.  Wouldn&#39;t it be great if  we could put this burden of maintaining constantly evolving time zone  rules and daylight saving time dates on the database?  Well, you get  this for free with TIMESTAMP WITH LOCAL TIME ZONE.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So if all we need to do is set the &lt;b&gt;database &lt;/b&gt;session time zone, then:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;How do we elegantly derive this for each end user of our application?&lt;/li&gt;&lt;li&gt;How  do we ensure that every page view and page submission in Application  Express has its database session time zone set correctly for a  particular user?&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There were numerous  suggestions in the past, of storing a user&#39;s preferred time zone as a  preference and then authoring a PL/SQL block in the VPD attribute of an  application like:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;http://joelkallman.blogspot.com/2010/09/automatic-time-zone-support-in.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://joelkallman.blogspot.com/2010/09/automatic-time-zone-support-in.html#&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://joelkallman.blogspot.com/2010/09/automatic-time-zone-support-in.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://joelkallman.blogspot.com/2010/09/automatic-time-zone-support-in.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;execute&lt;/span&gt;&lt;span&gt; immediate &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&#39;alter session set time_zone =&#39;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span&gt; || :MY_USER_TIMEZONE || &lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span&gt;;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;textarea style=&quot;display: none;&quot; class=&quot;sql&quot; name=&quot;code&quot;&gt;execute immediate &#39;alter session set time_zone =&#39;&#39;&#39; || :MY_USER_TIMEZONE || &#39;&#39;&#39;&#39;;&lt;/textarea&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Not  exactly obvious.  And this still doesn&#39;t answer question #1 of how do  we elegantly derive this.  This is where the new Automatic Time Zone  attribute is useful.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the Application  Builder, if you edit the Application Properties and navigate to the  Globalization subtab, you should see something like:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgig3wGiF5R3SOceQBEdjN5PjWd8AlQYOmbCDaNOTGmmY6Mg8econvXf0PWOjFttY_2NG1X2h7dSfUxjyUiG33AIdPxNZCuD2oB7RAd5i7MH3RZSPl9UILugnUimCHBZyQ4QsSohTkWQ4Ok/s1600/atz_1.png&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 400px; height: 146px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgig3wGiF5R3SOceQBEdjN5PjWd8AlQYOmbCDaNOTGmmY6Mg8econvXf0PWOjFttY_2NG1X2h7dSfUxjyUiG33AIdPxNZCuD2oB7RAd5i7MH3RZSPl9UILugnUimCHBZyQ4QsSohTkWQ4Ok/s400/atz_1.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5512379696875020722&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;By default, Automatic Time Zone will be set to &#39;No&#39;.  When set to &#39;Yes&#39;, this will now change the behavior of your application:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;At  the beginning of an Application Express session (which happens at the  beginning each time a user runs your application ), the time zone offset  will be calculated from their Web browser client.&lt;/li&gt;&lt;li&gt;This time  zone offset information will be sent to Application Express and recorded  in the APEX session information for that user.&lt;/li&gt;&lt;li&gt;Then, each and  every page view for the duration of their APEX session, the Application  Express engine will read this value and set the database session time  zone to this value.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;All you have to  do is employ data types which are time zone aware (like TIMESTAMP WITH  LOCAL TIME ZONE;  DATE is not time zone aware) and check a box in your  application definition.  It couldn&#39;t be simpler!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To demonstrate this, I created a simple application using the following DDL:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;http://joelkallman.blogspot.com/2010/09/automatic-time-zone-support-in.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://joelkallman.blogspot.com/2010/09/automatic-time-zone-support-in.html#&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://joelkallman.blogspot.com/2010/09/automatic-time-zone-support-in.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://joelkallman.blogspot.com/2010/09/automatic-time-zone-support-in.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;create&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;table&lt;/span&gt;&lt;span&gt; tz_log(   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    id number &lt;span class=&quot;keyword&quot;&gt;primary&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;key&lt;/span&gt;&lt;span&gt;,   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    username varchar2(255) &lt;span class=&quot;op&quot;&gt;not&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;op&quot;&gt;null&lt;/span&gt;&lt;span&gt;,   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    tz varchar2(512) &lt;span class=&quot;op&quot;&gt;not&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;op&quot;&gt;null&lt;/span&gt;&lt;span&gt;,   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    created_ts &lt;span class=&quot;keyword&quot;&gt;timestamp&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;op&quot;&gt;not&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;op&quot;&gt;null&lt;/span&gt;&lt;span&gt; );  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;  &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;create&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;op&quot;&gt;or&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;func&quot;&gt;replace&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;trigger&lt;/span&gt;&lt;span&gt; tz_log_trg1  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    before &lt;span class=&quot;keyword&quot;&gt;insert&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;on&lt;/span&gt;&lt;span&gt; tz_log  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    &lt;span class=&quot;keyword&quot;&gt;for&lt;/span&gt;&lt;span&gt; each row  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;begin&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    if :new.id &lt;span class=&quot;keyword&quot;&gt;is&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;op&quot;&gt;null&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;then&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;        :new.id := to_number(sys_guid(),&lt;span class=&quot;string&quot;&gt;&#39;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&#39;&lt;/span&gt;&lt;span&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    &lt;span class=&quot;keyword&quot;&gt;end&lt;/span&gt;&lt;span&gt; if;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;    &lt;span class=&quot;comment&quot;&gt;--&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;    :new.created_ts := localtimestamp;  &lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;end&lt;/span&gt;&lt;span&gt;;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;textarea style=&quot;display: none;&quot; class=&quot;sql&quot; name=&quot;code&quot;&gt;&lt;br /&gt;create table tz_log( &lt;br /&gt;    id number primary key, &lt;br /&gt;    username varchar2(255) not null, &lt;br /&gt;    tz  varchar2(512) not null, &lt;br /&gt;    created_ts timestamp not null  );&lt;br /&gt;&lt;br /&gt;create or replace trigger tz_log_trg1&lt;br /&gt;    before insert on tz_log&lt;br /&gt;    for each row&lt;br /&gt;begin&lt;br /&gt;    if :new.id is null then&lt;br /&gt;         :new.id :=  to_number(sys_guid(),&#39;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&#39;);&lt;br /&gt;     end if;&lt;br /&gt;    --&lt;br /&gt;    :new.created_ts :=  localtimestamp;&lt;br /&gt;end;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;div&gt;Then, I just built an application with a SQL report on this table and added an on New Instance PL/SQL Process of:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;http://joelkallman.blogspot.com/2010/09/automatic-time-zone-support-in.html#&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://joelkallman.blogspot.com/2010/09/automatic-time-zone-support-in.html#&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://joelkallman.blogspot.com/2010/09/automatic-time-zone-support-in.html#&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://joelkallman.blogspot.com/2010/09/automatic-time-zone-support-in.html#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;insert&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;into&lt;/span&gt;&lt;span&gt; tz_log (username, tz) &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;values&lt;/span&gt;&lt;span&gt;(:APP_USER, apex_util.get_session_time_zone );  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;commit&lt;/span&gt;&lt;span&gt;;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;textarea style=&quot;display: none;&quot; class=&quot;sql&quot; name=&quot;code&quot;&gt;insert into tz_log (username, tz) values(:APP_USER, apex_util.get_session_time_zone );&lt;br /&gt;commit;&lt;br /&gt;&lt;/textarea&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can run this &lt;a href=&quot;https://apex.oracle.com/pls/apex/f?p=27207:1&quot;&gt;sample application here&lt;/a&gt;.   Just keep in mind - it will require you to authenticate with your  oracle.com credentials (the same credentials you use if you login to the  OTN discussion forum) and it will record your visit in a log table,  which others can view.  Here&#39;s what it looks like - nothing fancy:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqhWrsZxRoECaIyAY3-imWyxa3FLY2YY3ufMgrlZ1o5IWaJmonnBQvRqV1EQk3IpRp6ehjwgx4BTSRZWY7c0bUAEqeIfPq6VIR7-T4AZPfD1rFJj3GloDKL_As-P4w2zIYPY0lGMMG4z_-/s1600/atz_2.png&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 161px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqhWrsZxRoECaIyAY3-imWyxa3FLY2YY3ufMgrlZ1o5IWaJmonnBQvRqV1EQk3IpRp6ehjwgx4BTSRZWY7c0bUAEqeIfPq6VIR7-T4AZPfD1rFJj3GloDKL_As-P4w2zIYPY0lGMMG4z_-/s320/atz_2.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5512382761372090866&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you pay close attention, immediately after authentication, you&#39;ll see a URL like:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;https://apex.oracle.com/pls/otn/f?p=27207:1:127976719236631&amp;amp;tz=-4:00&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Obviously,  your APEX session identifier and time zone value will be different than  what I show above.  But you&#39;ll see that there is a new parameter &#39;tz&#39;  to the &#39;f&#39; procedure.  And it is through this interface that you can  create a URL to an APEX application and explicitly set the APEX session  time zone to a different value.  After you login, change the time zone  value in the URL to something else (e.g., tz=0:00) and watch the values  in the &quot;Inserted into the Log Table (in your local time zone)&quot; report  column automatically adjust to that time zone.  The underlying report  definition didn&#39;t change - we&#39;re still simply selecting the TIMESTAMP  WITH LOCAL TIME ZONE column out of the database, just now the database  is automatically converting that value to display in the current session  time zone.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can also programmatically set  and get the APEX session time zone setting using two new APIs in  Application Express 4.0, namely &lt;a href=&quot;http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_util.htm#insertedID99&quot;&gt;APEX_UTIL.SET_SESSION_TIME_ZONE&lt;/a&gt; and &lt;a href=&quot;http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_util.htm#insertedID56&quot;&gt;APEX_UTIL.GET_SESSION_TIME_ZONE&lt;/a&gt;.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/4686210520627919614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/automatic-time-zone-support-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/4686210520627919614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/4686210520627919614'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/automatic-time-zone-support-in.html' title='Automatic Time Zone support in Application Express 4.0'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgig3wGiF5R3SOceQBEdjN5PjWd8AlQYOmbCDaNOTGmmY6Mg8econvXf0PWOjFttY_2NG1X2h7dSfUxjyUiG33AIdPxNZCuD2oB7RAd5i7MH3RZSPl9UILugnUimCHBZyQ4QsSohTkWQ4Ok/s72-c/atz_1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-7660409656697642674</id><published>2011-02-09T08:48:00.001-08:00</published><updated>2011-02-09T08:48:36.773-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="vt - Web Services"/><title type='text'>Oracle APEX Tutorial – A Web Service – Part 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Oracle APEX Tutorial – A Web Service – Part 1&lt;br /&gt;
&lt;br /&gt;
Introduction&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As the world moves forward, there is a higher need for more  information. However, it is a near impossible task to create and manage  all this information yourself. Sometimes, it’s easier to use freely  availible services and information feeds provided by others. One such  ‘feed’ is a Web Service. By sending a properly formed request to another  group over the web, you can receive information back, and display it on  your screen. A popular and easy to visualize example of this is getting  the local Movie Theater times and titles for current movies. This  tutorial will show how to do this.&lt;br /&gt;
&lt;br /&gt;
Part 1 – Creating the Base Application and Services&lt;br /&gt;
&lt;span class=&quot;vvqbox vvqyoutube&quot; style=&quot;height: 344px; width: 425px;&quot;&gt;&lt;/span&gt; &lt;br /&gt;
&lt;h2&gt;High Level Steps&lt;/h2&gt;1) Create Base Application (0:30)&lt;br /&gt;
2) Specify Proxy Settings (optional) (2:18)&lt;br /&gt;
3) Create a Web Service by WDSL (2:53)&lt;br /&gt;
4) Dreate a Web Service Manually (6:00)&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;The times in parenthesis are approximate start times for that step&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;285&quot; src=&quot;http://www.youtube.com/embed/9r2MIfPlVCU?rel=0&quot; title=&quot;YouTube video player&quot; width=&quot;340&quot;&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;/i&gt;&lt;br /&gt;
&lt;h2&gt;Notes and Resources&lt;/h2&gt;&lt;h3&gt;Web Services&lt;/h3&gt;Web Services are somewhat like the web itself, and can be transient  in nature. Due to this, the information presented in this tutorial is  accurate as of the time the tutorial was made. However, there may be  changes in the Web Service link, procedures, returned data and other  factors since the creation of this document. Web Services can by found  by either manually entering the information needed (as we are doing in  this tutorial) or by use of the UDDI (Universal Description, Discovery  and Integration) registry, which is a directory where businesses have  submitted thier available Web Services information for others to browse  and use.&lt;br /&gt;
&lt;h3&gt;SOAP&lt;/h3&gt;SOAP is the abbreviation for Simple Object Access Protocol. It is an  attempt to provide a platform neutral way to exchange requests and  results across the Internet. The SOAP standards are maintained by the  W3C, and may be superceeded in future protocol standards.&lt;br /&gt;
&lt;h3&gt;Testing Manual Services&lt;/h3&gt;Whenever you create and test a manual service it accomplishes two  things. One it tells you if you are getting back the correct  information, and two, it allows you to find the information refrences  you may need later when building the displayed report. In our case,  embedded in the returned results for the Movie Info service there are a  few things we need to take note of. One is the ‘base node’, another is  the ‘namespace’, also there is the ‘XPath’ and the ‘interesting  elements’ All of these will be used in the creation of the end report,  so it’s important to know them. Of course, this means that you should  have a good idea of the data you need from the web service before you go  invoking it.&lt;br /&gt;
&lt;h2&gt;Code and Pasted Text&lt;/h2&gt;WSDL Location Field&lt;br /&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;http://www.ignyte.com/webservices/ignyte.whatsshowing.webs
ervice/moviefunctions.asmx?wsdl&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;Manual Service Creation URL and Action&lt;br /&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;http://www.ignyte.com/webservices/ignyte.whatsshowing.webs
ervice/moviefunctions.asmx&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;http://www.ignyte.com/whatsshowing/GetTheatersAndMovies&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;Manual Creation SOAP Envelope&lt;br /&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
xmlns:tns=&quot;http://www.ignyte.com/whatsshowing&quot;
xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;&amp;gt;
&amp;lt;soap:Body&amp;gt;
&amp;lt;tns:GetTheatersAndMovies&amp;gt;
&amp;lt;tns:zipCode&amp;gt;#ZIP#&amp;lt;/tns:zipCode&amp;gt;
&amp;lt;tns:radius&amp;gt;#RADIUS#&amp;lt;/tns:radius&amp;gt;
&amp;lt;/tns:GetTheatersAndMovies&amp;gt;
&amp;lt;/soap:Body&amp;gt;
&amp;lt;/soap:Envelope&amp;gt;&lt;/pre&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;SOAP Response&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;MOVIE_RESULTS&lt;/pre&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/7660409656697642674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/oracle-apex-tutorial-web-service-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/7660409656697642674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/7660409656697642674'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/oracle-apex-tutorial-web-service-part-1.html' title='Oracle APEX Tutorial – A Web Service – Part 1'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/9r2MIfPlVCU/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-373084220989039825</id><published>2011-02-09T08:48:00.000-08:00</published><updated>2011-02-09T08:50:12.082-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="vt - Web Services"/><title type='text'>Oracle APEX Tutorial - A Web Service – Part 2</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Oracle APEX Tutorial - A Web Service – Part 2&lt;br /&gt;
&lt;br /&gt;
Introduction&lt;br /&gt;
&lt;br /&gt;
As the world moves forward, there is a higher need for more  information. However, it is a near impossible task to create and manage  all this information yourself. Sometimes, it’s easier to use freely  availible services and information feeds provided by others. One such  ‘feed’ is a Web Service. By sending a properly formed request to another  group over the web, you can receive information back, and display it on  your screen. A popular and easy to visualize example of this is getting  the local Movie Theater times and titles for current movies. This  tutorial will show how to do this. &lt;br /&gt;
&lt;br /&gt;
Part 2 – Creating the End Reports from the Web Service&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;285&quot; src=&quot;http://www.youtube.com/embed/SHFYl-Uqeh0?rel=0&quot; title=&quot;YouTube video player&quot; width=&quot;340&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;vvqbox vvqyoutube&quot; style=&quot;height: 344px; width: 425px;&quot;&gt;&lt;/span&gt; &lt;br /&gt;
&lt;h2&gt;High Level Steps&lt;/h2&gt;1) Create page, Buttons and Items (0:30)&lt;br /&gt;
2) Create the Call Process (4:38)&lt;br /&gt;
3) Create and test the Web Service Result Report (5:39)&lt;br /&gt;
&lt;i&gt;The times in parenthesis are approximate start times for that step&lt;/i&gt;&lt;br /&gt;
&lt;h2&gt;Notes and Resources&lt;/h2&gt;&lt;h3&gt;Web Services&lt;/h3&gt;Web Services are somewhat like the web itself, and can be transient  in nature. Due to this, the information presented in this tutorial is  accurate as of the time the tutorial was made. However, there may be  changes in the Web Service link, procedures, returned data and other  factors since the creation of this document.Web Services can by found by  either manually entering the information needed (as we are doing in  this tutorial) or by use of the UDDI (Universal Description, Discovery  and Integration) registry, which is a directory where businesses have  submitted thier available Web Services information for others to browse  and use.&lt;br /&gt;
&lt;h3&gt;Testing Manual Services&lt;/h3&gt;Whenever you create and test a manual service it accomplishes two  things. One it tells you if you are getting abck the correct  information, and two, it allows you to find the information refrences  you may need later when building the displayed report. In our case,  embedded in the returned results for the Movie Info service there are a  few things we need to take note of. One is the ‘base node’, another is  the ‘namespace’, also there is the ‘XPath’ and the ‘interesting  elements’ All of these will be used in the creation of the end report,  so it’s important to know them. Of course, this means that you should  have a good idea of the data you need from the web service before you go  invoking it.&lt;br /&gt;
&lt;h2&gt;Code and pasted Text&lt;/h2&gt;Result Node Path&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;/GetTheatersAndMoviesResponse/GetTheatersAndMoviesResult/Theater/Movies/Mov
ie&lt;/pre&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;Namespace&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;http://www.ignyte.com/whatsshowing&lt;/pre&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;Parameter Names&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;Name
Rating
RunningTime
ShowTimes&lt;/pre&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;Source - http://www.mandsconsulting.com/&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/373084220989039825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/oracle-apex-tutorial-web-service-part-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/373084220989039825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/373084220989039825'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/oracle-apex-tutorial-web-service-part-2.html' title='Oracle APEX Tutorial - A Web Service – Part 2'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/SHFYl-Uqeh0/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-352396478157387522</id><published>2011-02-09T08:47:00.000-08:00</published><updated>2011-02-09T08:51:04.080-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="vt - Access Controls"/><title type='text'>Oracle APEX Tutorial - Access Controls - Part 2</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Oracle APEX Tutorial - Access Controls - Part 2&lt;br /&gt;
&lt;br /&gt;
Walkthough of adding an Access Control system to an APEX application.  This part shows how to actually place the access restrictions in place,  and tests the application.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;285&quot; src=&quot;http://www.youtube.com/embed/IENd2j14bkA?rel=0&quot; title=&quot;YouTube video player&quot; width=&quot;340&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;
Introduction&lt;br /&gt;
&lt;br /&gt;
Security. We hear about it everywhere. Make this more secure, make  this less secure (okay, maybe we don’t hear that second part as often).  In the computer industry this is also true, and a constant need for any system or application. APEX allows for basic security by user login, but there is more you might need to do. For this, we have Acess Control.&lt;br /&gt;
&lt;br /&gt;
This tutorial will walk you though adding a custom authentication control setup to an application. If you haven’t already, we reccomend you review our article &lt;a href=&quot;http://www.mandsconsulting.com/apex-32-tutorial-preparation-and-oehr-sample-data-video-walkthrough&quot;&gt;OracleAPEX Tutorial Preparation and OEHR Sample Data Install&lt;/a&gt; to familiarize yourself with APEX.&lt;br /&gt;
This tutorial also uses a second downloaded file, which the link is below.&lt;br /&gt;
&lt;br /&gt;
Part 2 – Setting access restrictions and testing.&lt;br /&gt;
&lt;br /&gt;
Location of ACL_EMPLOYEE.zip file&lt;br /&gt;
&lt;a href=&quot;http://www.oracle.com/technology/products/database/application_express/packaged_apps/acl_employees.zip&quot;&gt;http://www.oracle.com/&lt;/a&gt;&lt;br /&gt;
Simply download the .zip file and extract it, keeping note of where you put the extracted file.&lt;br /&gt;
&lt;span class=&quot;vvqbox vvqyoutube&quot; style=&quot;height: 344px; width: 425px;&quot;&gt;&lt;/span&gt; &lt;br /&gt;
&lt;h2&gt;High Level Steps&lt;/h2&gt;1) Restrict access for View Users (0:30)&lt;br /&gt;
2) Restrict access for Edit Users (1:16)&lt;br /&gt;
3) Restrict access for Administrative Users (3:15)&lt;br /&gt;
4) Test Restrictions (4:15)&lt;br /&gt;
&lt;i&gt;Times in parenthesis are approximate start times for that step&lt;/i&gt;&lt;br /&gt;
&lt;h2&gt;Notes and Resources&lt;/h2&gt;&lt;h3&gt;Authentication Options&lt;/h3&gt;APEX offers you three primary ways you can authenticate your users.  The built in APEX option, no authentication, and by database account.  All of our tutorials so far have used the APEX built in option. Within  this option you can build more layers of controls, as we are in this  example, or leave it as is. When this boils down to is wether or not you  want to have to create APEX level accounts or program level accounts  for each user. Inthis example, we are creating program level accounts  based off the acl_employees data. Using this method, we don’t have to  create additional APEX system accounts, and you can better contain  access to the program and to the APEX system. The actual needs may vary  and you should consult your IT deparment to ensure you are complying  with any in-house security standards you may have in place.&lt;br /&gt;
&lt;h3&gt;Application Modes&lt;/h3&gt;We have the option of four modes in which the application can run in.  You can choose to run a given application in one of ‘Full Access to  all’ , ‘Restricted Access’, ‘Public Acess’, or ‘Administrative Access  Only’. We are using the second of these, as it allows us to define view,  edit and administrative levels of access and assign users to one of  those groups. The mode you need can vary by application and the needs  and policies of your group. Each level of access except for Full Access  still allows some restriction, based on the level you chose.&lt;br /&gt;
&lt;h3&gt;Access Inclusion&lt;/h3&gt;When you set a specific access level as we are in this example, it  means that is the minimum level needed to use that item. Any access  above that is included in the permissions. IE If you go to a page that  is set for view, if you have view, edit or admin rights you can use it,  but if you try and go to a edit restricted apge, anyone with view rights  is locked out, and only edit or higher (admin) will be able to proceed.&lt;br /&gt;
&lt;br /&gt;
Source - http://www.mandsconsulting.com/&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/352396478157387522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/oracle-apex-tutorial-access-controls_09.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/352396478157387522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/352396478157387522'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/oracle-apex-tutorial-access-controls_09.html' title='Oracle APEX Tutorial - Access Controls - Part 2'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/IENd2j14bkA/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-1865562245852552499</id><published>2011-02-09T08:46:00.000-08:00</published><updated>2011-02-09T08:51:44.303-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="vt - Access Controls"/><title type='text'>Oracle APEX Tutorial - Access Controls - Part 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Oracle APEX Tutorial - Access Controls - Part 1 &lt;br /&gt;
&lt;br /&gt;
Walkthough of adding an Access Control system to an APEX application.  This parts builds the base application, the access controls, and the  authorization functions.&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;285&quot; src=&quot;http://www.youtube.com/embed/-mc6zgA9eqY?rel=0&quot; title=&quot;YouTube video player&quot; width=&quot;340&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;Security. We hear about it everywhere. Make this more secure, make  this less secure. In the computer industry this is also true, and a  constant need for any system or application. APEX allows for basic  security by user login, but there is more you might need to do. For  this, we have Access Controls. This tutorial will walk you though adding  a custom authentication control setup to an application. If you haven’t  already, we reccomend you review our article &lt;a href=&quot;http://www.mandsconsulting.com/apex-32-tutorial-preparation-and-oehr-sample-data-video-walkthrough&quot;&gt;Oracle APEX Tutorial Preparation and OEHR Sample Data Install&lt;/a&gt; to familiarize yourself with APEX. This tutorial also uses a second downloaded file, which the link is below.&lt;br /&gt;
&lt;br /&gt;
Part 1 – Creating the Base Application and Controls&lt;br /&gt;
&lt;br /&gt;
Location of ACL_EMPLOYEE.zip file&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.oracle.com/technology/products/database/application_express/packaged_apps/acl_employees.zip&quot;&gt;http://www.oracle.com/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Simply download the .zip file and extract it, keeping note of where you put the extracted file.&lt;br /&gt;
&lt;span class=&quot;vvqbox vvqyoutube&quot; style=&quot;height: 344px; width: 425px;&quot;&gt;&lt;/span&gt; &lt;br /&gt;
&lt;h2&gt;High Level Steps&lt;/h2&gt;1) Creating and Testing the Base Application (0:30)&lt;br /&gt;
2) Create the Access Controls (3:30)&lt;br /&gt;
3) Add User to Access Control List (4:56)&lt;br /&gt;
4) Create and Link the Custom Authentication Function (6:10)&lt;br /&gt;
&lt;i&gt;Times in parenthesis are the approximate start time for that step&lt;/i&gt;&lt;br /&gt;
&lt;h2&gt;Notes and Resources&lt;/h2&gt;&lt;h3&gt;Authentication Options&lt;/h3&gt;APEX offers you three primary ways you can authenticate your users.  The built in APEX option, no authentication, and by database account.  All of our tutorials so far have used the APEX built in option. Within  this option you can build more layers of controls, as we are in this  example, or leave it as is. What this boils down to is wether or not you  want to have to create APEX system level accounts or program level  accounts for each user. In this example, we are creating program level  accounts based off the acl_employees data. Using this method, we don’t  have to create additional APEX system accounts, and you can better  contain access to the program and to the APEX system. The actual needs  may vary and you should consult your IT deparment to ensure you are  complying with any in-house security standards you may have in place.&lt;br /&gt;
&lt;h3&gt;Application Modes&lt;/h3&gt;We have the option of four modes in which the application can run in.  You can choose to run a given application in one of ‘Full Access to  all’ , ‘Restricted Access’, ‘Public Access’, or ‘Administrative Access  Only’. We are using the second of these, as it allows us to define view,  edit and administrative levels of access and assign users to one of  those groups. The mode you need can vary by application and the needs  and policies of your group. Each level of access except for Full Access  still allows some restriction, based on the level you chose.&lt;br /&gt;
&lt;h3&gt;Access Inclusion&lt;/h3&gt;When you set a specific access level as we are in this example, it  means that is the minimum level needed to use that item. Any access  above that is included in the permissions. IE If you go to a page that  is set for view, if you have view, edit or admin rights you can use it,  but if you try and go to a edit restricted page, anyone with view rights  is locked out, and only edit or higher (admin) will be able to proceed.&lt;br /&gt;
&lt;h2&gt;Code and Pasted Text&lt;/h2&gt;PL/SQL fuction&lt;br /&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;sql&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;OR&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;REPLACE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FUNCTION&lt;/span&gt; acl_custom_auth &lt;span style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;
p_username &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; VARCHAR2&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt;
p_password &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; VARCHAR2&lt;span style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;RETURN&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;BOOLEAN&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IS&lt;/span&gt;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;BEGIN&lt;/span&gt;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FOR&lt;/span&gt; c1 &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; acl_employees
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;UPPER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;userid&lt;span style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;UPPER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;p_username&lt;span style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;UPPER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;last_name&lt;span style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;UPPER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;p_password&lt;span style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;
LOOP
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;RETURN&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TRUE&lt;/span&gt;;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;END&lt;/span&gt; LOOP;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;RETURN&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FALSE&lt;/span&gt;;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;END&lt;/span&gt;;
&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;sql&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;Authorization Function Command&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;return acl_custom_auth&lt;/pre&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;html&quot; style=&quot;font-family: monospace;&quot;&gt;Source - http://www.mandsconsulting.com/&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/1865562245852552499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/oracle-apex-tutorial-access-controls.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/1865562245852552499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/1865562245852552499'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/oracle-apex-tutorial-access-controls.html' title='Oracle APEX Tutorial - Access Controls - Part 1'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/-mc6zgA9eqY/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-6052831442854322463</id><published>2011-02-07T14:41:00.000-08:00</published><updated>2011-02-07T14:42:15.467-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Administration"/><title type='text'>Reset INTERNAL password in APEX 3.0</title><content type='html'>&lt;p&gt;If you forget your APEX password of the INTERNAL workspace, here&#39;s what you can do:&lt;br /&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Connect to your database AS SYS DBA (or a user with high privileges): sqlplus sys as sysdba&lt;br /&gt;&lt;/li&gt;&lt;li&gt;SQL&gt; alter user FLOWS_030000 account unlock;&lt;/li&gt;&lt;li&gt;Connect to your database as FLOWS_030000: sqlplus flows_030000/password@your_db&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Run following procedure from SQL&gt;&lt;br /&gt;&lt;code&gt;begin&lt;br /&gt;www.flow_api.set_security_group_id (p_security_group_id =&gt; 10);&lt;br /&gt;www.flow_fnd_user_api.create_fnd_user(&lt;br /&gt;         p_user_name =&gt; &#39;admin1&#39;,&lt;br /&gt;      p_email_address =&gt; &#39;email@ae.com&#39;,&lt;br /&gt;      p_web_password =&gt; &#39;admin1&#39;);&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;commit;&lt;br /&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Connect again AS SYS DBA&lt;/li&gt;&lt;li&gt;SQL&gt; alter user FLOWS_030000 account lock;&lt;/li&gt;&lt;/ol&gt;That should have fixed your problem. Try again to login into APEX.</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/6052831442854322463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/reset-internal-password-in-apex-30.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/6052831442854322463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/6052831442854322463'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/reset-internal-password-in-apex-30.html' title='Reset INTERNAL password in APEX 3.0'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-4304150317938126980</id><published>2011-02-07T14:36:00.002-08:00</published><updated>2011-02-07T14:37:35.129-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Basics"/><title type='text'>Creating A Popup Window</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;Standard behaviour  in APEX is for a branch to link to a page using  the current window (or  tab). However there are times when it is  desirable for the application  to link to another page in a popup window.  This may be popup help, like  the standard help in APEX, or maybe a  print preview page. The  following is how to create a popup window.&lt;br /&gt;&lt;br /&gt;To  create the popup  window I am going to use Javascript. This can be  placed behind a button  or text link, or it can be placed in an HTML  region.&lt;br /&gt;&lt;br /&gt;The code to create the popup is very simple&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;window.open (URL, windowName[, windowFeatures]);&lt;/blockquote&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;windowName&lt;/span&gt;&lt;br /&gt;The  name of  the popup window. This name is not visible by the user, and is  only  there for reference by Javascript. For the example below I have  decided  to use the name popup1. If window.open was called again, using  &quot;popup1&quot;  as the windowName, then the contents of the popup would be  refreshed  with this new call. For this reason it is a good idea to use  unique  names for each window&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;URL&lt;/span&gt;&lt;br /&gt;In   the example code below I will simply call page 200 without passing in   any page item values. If you wish to pass in values, or pass in a   request value then please check out the post on &lt;a href=&quot;http://www.oracleapplicationexpress.com/2009/03/url-parameters.html&quot; target=&quot;_blank&quot;&gt;URL parameters&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;windowFeatures&lt;/span&gt;&lt;br /&gt;This   allows the developer to define specific features for the popup window.   For example, no scrollbars, the size of the window and whether certain   menu bars are visible. For a full list of features visit &lt;a href=&quot;http://www.javascript-coder.com/window-popup/javascript-window-open.phtml&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;The Javascript&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;window.open(&quot;f?p=&amp;amp;APP_ID.:200:&amp;amp;SESSION.&quot;,&quot;popup1&quot;);&lt;/blockquote&gt;&lt;br /&gt;The above line of code will open a new window (or tab depending on browser settings) called popup1, containing page 200. Easy.&lt;br /&gt;&lt;br /&gt;A couple of things to note when using popups.&lt;br /&gt;&lt;br /&gt;You   will see that I have passed in the current session value to the new   popup. This is useful as it allows the window to have access to all your   current session values, as well as knowing that you have passed   authentication. One issue with using the same session is that the two   windows could be able to access(or more importantly, alter) the same   session values at the same time. This can cause unexpected results.&lt;br /&gt;&lt;br /&gt;Therefore   it is sensible to have the popup as a deadend in your application. For   example this could be a single page containing a print preview of the   current page, with no links to any other page. For this reason it is a   good idea to use a template specific to popup pages. This template   should be as blank as possible and have little or no navigation items in   it.&lt;br /&gt;&lt;br /&gt;Another issue is the use of popup blockers. In most cases  it  is not known whether the end user is using a blocker, and how that   blocker will behave when the popup is called. Unfortunately there is no   easy answer to this and must be addressed on a case by case basis.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/4304150317938126980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/creating-popup-window_07.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/4304150317938126980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/4304150317938126980'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/creating-popup-window_07.html' title='Creating A Popup Window'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-8374469683027130900</id><published>2011-02-07T14:36:00.001-08:00</published><updated>2011-02-07T14:36:38.985-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Basics"/><title type='text'>Clearing Cache</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;In another page I explained the format of the &lt;a href=&quot;http://apex-monkeys.blogspot.com/2011/02/url-parameters.html&quot;&gt;URL&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;f?p=1:2:3:4:5:6:7:8:9&lt;br /&gt;&lt;br /&gt;Parameter   number 6 allowed you to reset the cache for specific pages. Sometimes   however, there is a need to reset the cache for the whole application.   This can also be done using this parameter with the following two   options&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;APP&lt;/span&gt;&lt;br /&gt;Clears   cache for all pages and all application-level items in the current   application and removes sort preferences for the current user.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;SESSION &lt;/span&gt;&lt;br /&gt;Achieves   the same result as the APP keyword, but clears items associated with   all applications that have been used in the current session.&lt;br /&gt;&lt;br /&gt;There   is also a way to reset the cache using PL/SQL. The following code  would  clear the cache of application 100 for the current session&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;APEX_UTIL.CLEAR_APP_CACHE(&#39;100&#39;);&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;and the following code would clear the cache of page 100&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;APEX_UTIL.CLEAR_PAGE_CACHE(&#39;100&#39;);&lt;/blockquote&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/8374469683027130900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/clearing-cache_07.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/8374469683027130900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/8374469683027130900'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/clearing-cache_07.html' title='Clearing Cache'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-8822858455683757806</id><published>2011-02-07T14:34:00.002-08:00</published><updated>2011-02-07T14:35:46.109-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Basics"/><title type='text'>URL Parameters</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;In most cases the  URL is automatically handled by APEX and the  developer does not need to  understand it. However with more advanced use  of APEX comes the need  to manually specify certain aspects of the URL.  The following is a  quick explanation of how the URL is constructed.&lt;br /&gt;&lt;br /&gt;For this explanation we will focus on the f?p= part of the URL and explain each specific parameter&lt;br /&gt;&lt;br /&gt;f?p=1:2:3:4:5:6:7:8:9&lt;br /&gt;&lt;br /&gt;1 - The number or alias of the application you wish to run. The alias can be set in shared components -&amp;gt; definition&lt;br /&gt;&lt;img src=&quot;http://www.oracleapplicationexpress.com/uploaded_images/Edit-Application-Definition-765589.png&quot; width=&quot;400&quot; border=&quot;0&quot; /&gt;&lt;br /&gt;To access the current application id, use &amp;amp;APP_ID.&lt;br /&gt;&lt;br /&gt;2 - The page number or page alias. The page alias can be set in the page attributes&lt;br /&gt;&lt;img src=&quot;http://www.oracleapplicationexpress.com/uploaded_images/Edit-Page-776571.png&quot; width=&quot;400&quot; border=&quot;0&quot; /&gt;&lt;br /&gt;3 - The session. to access the current session, use &amp;amp;SESSION.&lt;br /&gt;&lt;br /&gt;4 - The request term that you want to pass to the destination page&lt;br /&gt;&lt;br /&gt;5 - DEBUG. Decide whether the page is run in debug mode or not. either YES or NO&lt;br /&gt;&lt;br /&gt;6 - This parameter can accept two values. RP = resets the pagination of the destination page followed by a comma &lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_0&quot;&gt;separated&lt;/span&gt;   list of pages where you wish to reset the cache. So for example if you   want to reset pagination and reset the cache for pages 1 and 2 you  would  include &quot;RP,1,2&quot; for this parameter&lt;br /&gt;&lt;br /&gt;7 - Comma separated list of page items to assign values to.&lt;br /&gt;&lt;br /&gt;8 - Comma separated list of values to assign to the page items specified at position 7. The values must be in &lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_1&quot;&gt;the&lt;/span&gt; same order as the page items are&lt;br /&gt;&lt;br /&gt;9 - Printerfriendly. Determines if the page is being rendered in printer friendly mode. YES or blank&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/8822858455683757806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/url-parameters_7555.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/8822858455683757806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/8822858455683757806'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/url-parameters_7555.html' title='URL Parameters'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-5951735272252370644</id><published>2011-02-07T14:33:00.002-08:00</published><updated>2011-02-07T14:34:15.230-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AJAX"/><category scheme="http://www.blogger.com/atom/ns#" term="Basics"/><title type='text'>Basics of Ajax</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;In Application  Express(APEX) it is possible to communicate with the  database without  submitting the entire page. This is extremely useful  when your APEX  application is being run on a very slow network. This on  demand  communication is possible in APEX using Asynchronous JavaScript  and  XML(Ajax). Using this method sends only the minimum information   required to retrieve a value from the database. I will explain using a   simple example involving the famous emp table.&lt;br /&gt;&lt;br /&gt;lets say I have a page that has three items on it&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;P1_EMPID. this will be a textfield used to enter the emp_id&lt;/li&gt;&lt;li&gt;P1_ENAME. this will be used to display the ename&lt;/li&gt;&lt;li&gt;SUBMIT.  this will be a button that will submit the page. this page  submission  will fire off a process that will populate P1_DISPLAY with  the relevant  ename for the given emp_id&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;The issue with the above  example is that the entire page has  to be reloaded when in fact only  one small section will be updated,  namely P1_DISPLAY. the following  example will demonstrate how to  retrieve the name from the database  without refreshing the page.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1.  Move the database code from  the page process and place it in an  application process. Name the  process &quot;GET_ENAME&quot; and give it a type of  &quot;On Demand&quot;. example code is  below&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;font-weight: bold; padding-left: 20px;&quot;&gt;declare&lt;br /&gt;v_ename emp.ename%type;&lt;br /&gt;begin&lt;br /&gt;select ename&lt;br /&gt;into v_ename&lt;br /&gt;from emp&lt;br /&gt;where emp_id = :P1_EMPID;&lt;br /&gt;htp.prn(v_ename);&lt;br /&gt;exception when others then htp.prn(&#39;An error occurred retrieving the name&#39;);&lt;br /&gt;end;&lt;/div&gt;2. Create the following javascript function.&lt;br /&gt;&lt;div style=&quot;padding-left: 20px;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;function get_ename(){&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;/*&lt;br /&gt;retrieve the emp_id from the page&lt;br /&gt;*/&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;var emp_id = document.getElementById(&#39;P1_EMPID&#39;).value;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;/*&lt;br /&gt;define the Ajax call. The only variable of note in this example is the&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; application_process, which I have set to be the same name as step 1.&lt;/span&gt;&lt;br /&gt;*/&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;var get = new htmldb_Get(null,html_GetElement(&#39;pFlowId&#39;).value, &#39;APPLICATION_PROCESS=GET_ENAME’,0);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;/*&lt;br /&gt;add the value in P1_EMPID into the session value for P1_EMPID.&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; this is important as without this step the APEX server would not know&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;what value the user had entered&lt;/span&gt;&lt;br /&gt;*/&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;get.add(&#39;P1_EMPID&#39;,emp_id);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;/*&lt;br /&gt;call the ondemand process and accept the returning ename&lt;/span&gt;&lt;br /&gt;*/&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;var gReturn = get.get();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;/*&lt;br /&gt;set the field on the page to equal the ename retrieved from the database&lt;/span&gt;&lt;br /&gt;*/&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;document.getElementById(&#39;P1_ENAME&#39;).value = gReturn;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;3. Finally alter the SUBMIT button so that it uses a URL redirect and in the URL field enter&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;javascript:get_ename();return false;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;and   thats it, when you press the submit button it will now send the emp_id   to the database and populate P1_ENAME with the relevant name. and all   without refreshing the page.&lt;br /&gt;&lt;br /&gt;obviously this is a trivial example but it gives an idea of the possibilities of Ajax.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/5951735272252370644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/basics-of-ajax_07.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/5951735272252370644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/5951735272252370644'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/basics-of-ajax_07.html' title='Basics of Ajax'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-2938947918739236167</id><published>2011-02-07T14:33:00.001-08:00</published><updated>2011-02-07T14:33:26.511-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Basics"/><title type='text'>File Browse - filename length limit</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;I use the built in  &quot;File Browse&quot; item in many of my applications and  for a long time I had  not experienced any issues. However, recently I  noticed that there was  an issue when using large filenames. If I  selected a large filename  and submitted the page a HTML error page was  displayed. What surprised  me was that this was not the usual APEX error  page. After some  investigation I found an interesting post on the APEX  forums at Oracle.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://forums.oracle.com/forums/message.jspa?messageID=2437324&quot; target=&quot;_blank&quot;&gt;http://forums.oracle.com/forums/message.jspa?messageID=2437324&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It   seems that there is a limit of 70 characters for the filename. It   should be noted that this limit is solely for the filename, and does not   include the path. This limit is purely down to how APEX internally   stores the file in wwv_flow_files.&lt;br /&gt;&lt;br /&gt;I have implemented the   validation check described in the thread, with very slight changes to   better suit my needs. The following is how I have done this.&lt;br /&gt;&lt;br /&gt;Firstly I created the Javascript&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;function checkFileName(pThis){&lt;br /&gt;if (pThis.value != &quot;&quot;) {&lt;br /&gt;//get path value (including file name)&lt;br /&gt;var fileAndPath = pThis.value;&lt;br /&gt;//find the index of the last &quot;\&quot;&lt;br /&gt;var lastPathDelimiter = fileAndPath.lastIndexOf(&quot;\\&quot;);&lt;br /&gt;//get everything after the last &quot;\&quot;&lt;br /&gt;var fileNameOnly = fileAndPath.substring(lastPathDelimiter+1);&lt;br /&gt;&lt;br /&gt;if (fileNameOnly.length &amp;gt;70) {&lt;br /&gt;alert(&quot;File name &quot; + fileNameOnly +&lt;br /&gt;&quot; is too long. Filename can be maximum of 70 characters in length&quot;);&lt;br /&gt;return false; //filename is not valid&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;return true; //filename is valid. so continue&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;In  addition to displaying an error message if the filename is  greater  than 70, I decided to return a Boolean value to indicate  whether the  filename had passed the test or not.&lt;br /&gt;&lt;br /&gt;This boolean  could then be  used along with a button to submit the page when the  filename passed  the test, or remain on the page if the name fails.&lt;br /&gt;&lt;br /&gt;I  created a  button called UPLOAD with the following code within the URL   Redirect.(F1_FILE_NAME is the name of the file browse item)&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;javascript:if(!checkFileName($x(&#39;P1_FILE_NAME&#39;)))return false;doSubmit(&#39;UPLOAD&#39;);&lt;/blockquote&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;text-align: left;&quot;&gt;&lt;img src=&quot;http://www.oracleapplicationexpress.com/uploaded_images/URL-Redirect-738062.png&quot; width=&quot;400&quot; border=&quot;0&quot; /&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/blockquote&gt;The  above example is very simple but I think that implementing  something  similar is essential if the built in &quot;File Browse&quot; button is  used in a  production application.&lt;br /&gt;&lt;br /&gt;Thank you goes to Mike and Arie for their examples in the aforementioned thread&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/2938947918739236167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/file-browse-filename-length-limit_07.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/2938947918739236167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/2938947918739236167'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/file-browse-filename-length-limit_07.html' title='File Browse - filename length limit'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5531051101500543810.post-2550043600833362906</id><published>2011-02-07T14:31:00.001-08:00</published><updated>2011-02-07T14:31:31.510-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Basics"/><title type='text'>How to stop the user from clicking a page submit button more than once</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;The standard way to  push the page data back to the APEX server is to  use an HTML button.  One issue with HTML buttons is that they can be  clicked more than once,  and under certain circumstances this can cause  issues. To ensure that  the button can only be pressed once you can do  the following.&lt;br /&gt;&lt;br /&gt;alter button settings so that inside the URL redirect section the URL target value is set to&lt;br /&gt;&lt;br /&gt;javascript:this.disabled=true;doSubmit(&#39;SUBMIT&#39;)&lt;br /&gt;&lt;img src=&quot;http://www.oracleapplicationexpress.com/uploaded_images/SUBMIT-Button-768406.png&quot; width=&quot;400&quot; border=&quot;0&quot; /&gt;&lt;br /&gt;Note that the value inside doSubmit(&#39;&#39;) is the same as the button name.&lt;br /&gt;&lt;br /&gt;You   can even go one step further and replace the text of the button to   something relevant like &quot;Submitting....&quot;. The following code does this&lt;br /&gt;&lt;br /&gt;javascript:this.disabled=true;this.value=&#39;Submitting....&#39;;doSubmit(&#39;SUBMIT&#39;);&lt;br /&gt;&lt;br /&gt;The button now looks like this when it has been clicked&lt;br /&gt;&lt;img src=&quot;http://www.oracleapplicationexpress.com/uploaded_images/submitting-button-798475.png&quot; width=&quot;106&quot; border=&quot;0&quot; height=&quot;43&quot; /&gt;&lt;br /&gt;Thats it, the button is now coded so that the user can only click it once to submit the page. Any further clicks are ignored.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://apex-monkeys.blogspot.com/feeds/2550043600833362906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/how-to-stop-user-from-clicking-page_07.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/2550043600833362906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5531051101500543810/posts/default/2550043600833362906'/><link rel='alternate' type='text/html' href='http://apex-monkeys.blogspot.com/2011/02/how-to-stop-user-from-clicking-page_07.html' title='How to stop the user from clicking a page submit button more than once'/><author><name>Apex Monkey</name><uri>http://www.blogger.com/profile/01504678646727660005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>