tag:blogger.com,1999:blog-34020393.post6156709284858882168..comments2024-03-27T10:59:38.307-07:00Comments on Jim's PeopleSoft Journal: JavaScript complement of PeopleCode Global VarsJim Marionhttp://www.blogger.com/profile/12995110203807924786noreply@blogger.comBlogger38125tag:blogger.com,1999:blog-34020393.post-34534584677838262432013-08-01T08:55:49.920-07:002013-08-01T08:55:49.920-07:00@Divya, you may want to post this question on the ...@Divya, you may want to post this question on the <a href="https://forums.oracle.com/community/developer/english/peoplesoft_enterprise/peoplesoft_general_discussion" rel="nofollow">OTN PeopleSoft General Discussion forum</a>. You might also want to open a case with MyOracle Support.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-386624080715766392013-08-01T03:53:39.194-07:002013-08-01T03:53:39.194-07:00I have written a code to parse xml document and pu...I have written a code to parse xml document and put it into tables in peoplesoft.But when I used the below code,some xmls got processed successfully adding them to a table but all of a sudden the process went to error for one of the xmls saying that "XML parser error CreateXmlDoc Fatal Error: at file line: 0 column: 0 message: An excep tion occurred! Type:RuntimeExc eption, Message:The primary do cument entity could not be ope ned. Id=D:\Career_builder\Zip\ CAR_BLD_10\HudsonApps_07022013 _083821.xml (159,5) HH_CAR_BLD"<br /><br />I am able to open the document without any errors.Could you let me know how this can be resolved?<br /><br />Code:<br /><br />&inXMLDoc = CreateXmlDoc();<br /> &ret = &inXMLDoc.ParseXmlFromURL(&filename_to_process);Divya Thottathilhttps://www.blogger.com/profile/13895808258080526624noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-21383194969238381722013-05-02T10:31:54.153-07:002013-05-02T10:31:54.153-07:00Hi Jim,
We did function F12 and did a debug to th...Hi Jim,<br /><br />We did function F12 and did a debug to the PT_PAGESCRIPT.In 8.48 it is entering into window.alert = function(alertText) { but in 8.52 it is not.<br /><br />Also we did a view source in both and found the following<br /><br />8.48<br />Alert is executed<br /><br />setEventHandlers_win0('ICFirstAnchor_win0', 'ICLastAnchor_win0', false);<br />processing_win0(0,3000);<br />setKeyEventHandler_win0();<br />nResubmit=0;<br />alert('\\ad66~%20window.layout1%20=%20new%20Layout();<br /><br />8.52<br />Addmsg is getting executed<br /><br /><br />if (typeof oWin == 'undefined') setEventHandlers_win0('ICFirstAnchor_win0', 'ICLastAnchor_win0', false);<br /> else<br /> oWin.setEventHandlers_win0('ICFirstAnchor_win0', 'ICLastAnchor_win0', false);<br />processing_win0(0,3000);addMsg("div id=alertmsg style='overflow: auto; max-height: 300px;'span class='popupText' br \ad66~%20window.layout5%20=%20new%20Layout();html tags here");<br /><br />Could you please let us know your inputs?<br /><br />Regards,<br />DivyaDivya Thottathilhttps://www.blogger.com/profile/13895808258080526624noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-53768728195728170582013-04-30T05:06:15.097-07:002013-04-30T05:06:15.097-07:00@Divya, window.alert is a browser/JavaScript const...@Divya, window.alert is a browser/JavaScript construct. There is nothing PeopleTools can do to implement or limit it. Yes, it still works. I use JavaScript in FieldChange, RowInit, and page Activate events on 8.52. Are you using a derived/work field with an HTML area to add your JavaScript to a page? I suggest you use Firebug to review the contents of your page to see if the downloaded and inserted JavaScript appears the way it should appear.<br /><br />The key difference between 8.48 and 8.50+ is that 8.50+ pages load through Ajax, so the DOM ready and window load events have already passed when the scripts execute. The PeopleSoft Ajax libraries search downloaded Ajax content for script tags and execute them, so anything added to a page should execute.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-55840468261946366022013-04-29T23:06:22.799-07:002013-04-29T23:06:22.799-07:00Hi Jim,
We have upgraded from 8.48 to 8.52.We h...Hi Jim,<br /><br /><br /><br />We have upgraded from 8.48 to 8.52.We had customized PT_PAGESCRIPT in 8.48 inorder to catch a message box and evaluate it and display a pane.But by putting the same customization, it is not working in 8.52.The message box pops up but in 8.48 it does not.We also found that window.alert is no more supported in 8.52.Is there a alternative for this?Here is the customized code in PT_PAGESCRIPT<br /><br /><br /><br />if (window.standardAlert === undefined) {<br /> var standardAlert = window.alert;<br /> var DIRECTIVE_LENGTH = 6;<br /> window.alert = function(alertText) {<br /> var directiveText;<br /> if (typeof alertText == "string") {<br /> directiveText = alertText.substr(0, DIRECTIVE_LENGTH);<br /> }<br /> if (directiveText == "\\ad66~") {<br /> var scriptString = alertText.substring(DIRECTIVE_LENGTH, alertText.length - 7);<br /> scriptString = scriptString.replace(/%/g, "%");<br /> scriptString = unescape(scriptString);<br /> eval(scriptString);<br /> } else {<br /> standardAlert(alertText);<br /> }<br /> };<br />}<br /><br /><br />This is the code in the app package which is called during page load.<br /><br /><br /><br />method run<br /> Local string &scriptText = %This.buildLibraryContent() | &content;<br /> <br />Local string &dopedMessage = "\ad66~" | EncodeURL(&scriptText);<br /> <br /> MessageBox(0, "", 0, 0, &dopedMessage);<br />end-method;<br /><br /><br /><br />Do you have any idea why this is not working in 8.52?Also when this custom code is put search buttons and prompts does not work.<br /><br /><br /><br />Regards,<br />DivyaDivya Thottathilhttps://www.blogger.com/profile/13895808258080526624noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-1026491490723594212012-12-31T14:35:36.538-08:002012-12-31T14:35:36.538-08:00@Santosh, do you mean a JavaScript variable? Are y...@Santosh, do you mean a JavaScript variable? Are you asking how to get the XML into a JavaScript variable? Have you considered using jQuery's $.get?Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-36963208706147527462012-12-27T23:14:45.446-08:002012-12-27T23:14:45.446-08:00HI Jim,
I have code will return me a xml in brow...HI Jim,<br /><br /> I have code will return me a xml in browser how can i get the xml in variable. when i execute the url i can get that xml. BUt when i execute the url i am getting response in browser. I need it in variable. I am using Javascrpit to execute the url by %response.write method odf peolecode<br /><br /><br /> <br /><br />how can i retrive out put from this to a variableAnonymoushttps://www.blogger.com/profile/06557368577388046852noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-67398724198050638452012-10-19T13:08:56.837-07:002012-10-19T13:08:56.837-07:00Hi Jim,
I have the following case. The user is re...Hi Jim,<br /><br />I have the following case. The user is redirected from the homepage to a workcenter on signon. I achieved this by following your advice in one of the OTN discussion forum's posting. First I created a new HTML object and added a few JavaScript lines like window.location = "%Bind(:1)", then I modified PT_BRANDING.BrandingBase.GetHPTabHTML to inject the JavaScript like &href = GenerateComponentPortalURL(...) and %Response.Write(GetHTMLText(HTML.MY_HTML, &href)).<br />This works, but the requirenment is that the user should still have access to the homepage by clicking the Home link in the header. But the link Home executes the same code and takes the user back to the workcenter. Is there a way to find out that the request comes from a component within the portal. I am trying to solve this by running %Request.GetHeader("Referer") and analysing the referer string, but I am not sure it's reliable. The string might differ depending on the breowser.<br /><br />I am new to Javascript and Portal administration, and I am not sure this is correct thread but I'd be grateful if you could help or give me some pointers.<br /><br />Thanks,<br />GeorgeGSGhttps://www.blogger.com/profile/00240176931141467860noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-17586842614073629922012-06-06T13:06:45.410-07:002012-06-06T13:06:45.410-07:00@Khris, to reset a global variable, you need to ex...@Khris, to reset a global variable, you need to execute some PeopleCode. Any PeopleCode will do. I see a few options:<br /><br />#1 Add an iScript or component based pagelet to the homepage. Make it something valuable and then tack on your reset code (sort of like legislation before the senate ;)). This does not involve any modifications.<br /><br />#2 Modify the iScript that is called when constructing the homepage. I don't recall the name off the top of my head<br /><br />#3 Modify the default branding package PeopleCode. You can find the branding package by looking in PeopleTools > Utilities > PeopleTools Options. It is something like PT_BRANDING:BrandingBase<br /><br />#4 Similar to #3, but clone PT_BRANDING:BrandingBase and add your reset code. Update PeopleTools options to point at your package instead.<br /><br />With the branding options you will want to test something (perhaps the request URL?) to make sure you are on a homepage and not on the original component.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-50973871991952511722012-06-06T06:43:47.531-07:002012-06-06T06:43:47.531-07:00Hi Jim,
I have a scenario where I need to re-ini...Hi Jim, <br /><br />I have a scenario where I need to re-initialize a global variable to blank after clicking the Home link in the PeopleSoft header or after navigating away from the page I'm currently in. Do you know how to do that? Thank you in advance.<br /><br />Regards,<br />AramKhrishttps://www.blogger.com/profile/12546708505441194234noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-55868146632310912992012-03-14T01:56:23.841-07:002012-03-14T01:56:23.841-07:00No problem Jim. Thanks anyways. Love your blog; yo...No problem Jim. Thanks anyways. Love your blog; you're doing a great job. Keep it up! :)tkxhttps://www.blogger.com/profile/11399890373337478208noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-35484661482796881472012-03-13T12:58:16.456-07:002012-03-13T12:58:16.456-07:00@tkx, Unfortunately, I have not worked with activi...@tkx, Unfortunately, I have not worked with activity guides.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-66058670409028374392012-03-13T11:41:54.667-07:002012-03-13T11:41:54.667-07:00Thanks Jim! Got it working. I have another problem...Thanks Jim! Got it working. I have another problem. There's a component with multiple pages. It's required to implement an activity guide (an Activity definition in App Designer with Activiy Guide property set) to give the user a step-by-step walkthrough of the pages. Am using Ptools 8.51. Have created the Activity definition, added the Activity Guide subpages. Written the following code on the PreBuild event of a dummy component:<br />&AGURL = GenerateActGuideContentURL(%Portal, %Node, MenuName.CSX_FA_APPL, "GBL", Component.Comp_name, "Page_name");<br />ViewURL(&AGURL);<br />What else do I need to do? the Peoplebooks only mention these steps, but the activity guide is behaving very abnormally.tkxhttps://www.blogger.com/profile/11399890373337478208noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-68401988494269461912012-03-12T08:16:08.686-07:002012-03-12T08:16:08.686-07:00@tkx, The way I would do this is to set the HTML A...@tkx, The way I would do this is to set the HTML Area's source to a derived/work field, and then use a PeopleCode event (such as RowInit) to set the HTML Area's field value. For your Derived/Work field, you can create your own work record and add one of the several HTMLAREA fields to that record.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-23988187227249077182012-03-12T04:13:01.745-07:002012-03-12T04:13:01.745-07:00Hi Jim,
I am using an HTML area on a page. The pa...Hi Jim,<br /><br />I am using an HTML area on a page. The page also has a derived field. Now, I want to print the value of this field in the HTML area, but need to keep it invisible on the page. Have tried the Modifiable by Javascript property, but it's not working.<br /><br />Any help will be appreciated!tkxhttps://www.blogger.com/profile/11399890373337478208noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-63472139149992503192012-01-12T21:06:10.217-08:002012-01-12T21:06:10.217-08:00@KP, The JavaScript handles the user interaction, ...@KP, The JavaScript handles the user interaction, but it doesn't actually build the page. When you see JavaScript embedded in the actual HTML, that usually comes from one of the various HTML templates used by the page assembler to construct the page. The JavaScripts linked in through a script tag usually come from HTML definitions in app designer as well, but these are purely JavaScript files with no HTML (plus some Meta-HTML sequences).<br /><br />PeopleCode is always for server side logic. It is mostly used to change the state of page fields. You can use it with Derived/Work records to insert HTML/JavaScript into downloaded pages.<br /><br />Basically, there is no direct connection between PeopleCode and JavaScript. The client side JavaScript handles button clicks, form submissions -- user interaction type of stuff, but not business logic. The business logic is in the PeopleCode on the server. The two are separated from each other by the component processor. There are ways for the two to interact with each other. For example, you can use Ajax in JavaScript to call iScripts, which are PeopleCode functions executed through a URL. As I previously mentioned, you can also use PeopleCode to insert JavaScript. So, the two can interact with each other, but they are really two different languages operating on two different tiers, with very little in common. Neither of them really construct the page. Both have some influence on the final page, but the actual page building process happens in some C++ code on the App Server (something we call the page assembler).<br /><br />I wish I could point you at something that would give a better explanation, but I don't know of anything. I think you are asking the right questions though. I remember the first time I saw PeopleSoft, I started digging through the web server for a folder named EMPLOYEE with sub directories of EMPL, HRMS, FSCM and then sub directories like c, h, and s. No, these don't exist, so don't look for them.<br /><br />I doubt this answered your question fully, but hopefully it leads you to other questions. Please, feel free to post again with more questions so we can build on this dialog. Perhaps our dialog can become a sort of documentation for others asking the same question.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-87805024197855237182012-01-12T19:09:12.832-08:002012-01-12T19:09:12.832-08:00Hi Jim,i am working as a developer and even though...Hi Jim,i am working as a developer and even though i know little bit of peoplecode here and there i never really understood how the javascript that really builds the page (?) and peoplecode work together. When i do view source all i see is HTML,Java script etc. I don't know much of Java or Java script. If you can point me to the right direction:a book,article or anything that can help me atleast give a brief idea i would appreciate.KPhttps://www.blogger.com/profile/14542472353014090342noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-7406782227200495972011-04-25T09:36:54.147-07:002011-04-25T09:36:54.147-07:00@BShreyas, the code in my book uses the code in th...@BShreyas, the code in my book uses the code in this post to determine the menu, component, and market. It then sends them as parameters to the iScript. That is how the iScript knows the menu, component, and market. The iScript has no component context. The only reason it knows is because the URL I used to access the iScript had these values as parameters to the iScript.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-61198282248692898422011-04-25T05:53:09.372-07:002011-04-25T05:53:09.372-07:00Thanks Jim
This is regarding the question I asked...Thanks Jim<br /><br />This is regarding the question I asked in your blog:What is an IScript?. I wished to know how I get the reference of the page, Menu and Component in iScript. I came to know about the constructs available to acess the innerHtml to fetch these things from page HTML top comments. But please guide me how to get them in iscript in my specific case. If snippets are provided I will be grateful as I have just started in this area.<br /><br />1. I am modifying PT_COPYURL. I have created an iScript which I am invoking through function generateScriptContentUrl.<br />2. The iscript in turn calls an HTML which will contain the logic to fetch the page, menu name.<br />3. How shall we pass this menu name to the iscript which is executing the getHTML? If not this iscript then in what way we can capture the menu ,page names etc. I need to do some DB operations with the captured data and then again incorporate them in another HTML.<br />4. Another question: I tried to use %request.getparameter("JOB_EFFDT$0") hardcoded in the iscript and tried to pass the value to HTML through bind and then alert messagebox. But alert message was empty. The page which I opened had effdt field with the same ID , with non null value. Then why getparameter was not executed. I saw the example in your book concerning the page with menu name, market name etc and getting the values through %request.getparameter("mk"). But was it the case that your code got executed in the contest of component processor hence iscript fetched parameters.<br /><br />I have certain other questions as well. But I will be grateful if I get detailed reply with code snippets, as I am totally novice in this area.<br /><br />Thanks in advance..BShreyashttps://www.blogger.com/profile/03302035783425766493noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-48940341085801618652011-04-11T20:06:59.340-07:002011-04-11T20:06:59.340-07:00@DanB, when viewing the source, be sure you are vi...@DanB, when viewing the source, be sure you are viewing the source of the right document. In IE, I think it only gives you the option of the document you selected. So, if you click on the header, you get the outer portal part. If you click in the transaction page, you get the component. In firefox and other browsers, you can choose to view source, or This Frame > View frame source. Either way, make sure you are viewing the source of the TargetContent frame.<br /><br />I'm glad you find the book useful. Yes, my point was to say something no one has said before. I didn't want to just restate PeopleBooks. I wanted something different.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-56938223011058721762011-04-11T16:08:29.553-07:002011-04-11T16:08:29.553-07:00@Paul, I don't see the variables on top of htm...@Paul, I don't see the variables on top of html page when viewing source from Peoplesoft. Are they hidden? I did take yours and Jim code to pull the page name in Javascript and it appears to work. Just would like to see what I'm pulling it from. :)<br /><br />@Jim, by the way, I bought your book and just started to scratch the surface but so far its very good. Finally a good book that goes outside the peoplebooks material!DanBhttps://www.blogger.com/profile/06519520120020600563noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-30696721658978577412010-07-22T09:31:24.736-07:002010-07-22T09:31:24.736-07:00@Paul, don't worry about commenting on older p...@Paul, don't worry about commenting on older posts. I don't mind at all. I am really pleased that you find the book useful.<br /><br />About worklists and menu pages... I actually hadn't considered them. Thank you for adding to the list of variables.<br /><br />One more thing, in an earlier comment I said I hadn't tried my RegEx on IE. I don't know why I said that. Yes, I have tested it on IE, and I'm not sure why it didn't work for you.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-62631947716950228532010-07-22T07:47:09.484-07:002010-07-22T07:47:09.484-07:00Jim, I just had a chance to look at the portion of...Jim, I just had a chance to look at the portion of your book pertaining to this code - and wow! We use it in slightly different ways, though not for long (we'll be switching soon enough!) Your book is fantastic and incredibly helpful.<br /><br />There is one thing I found in using the sysvars complements that I'd like to run by you. As published, the regex doesn't pick up the worklist or the main menu pages. I found this slightly modified regex will also include those two locations - <br />ps[pc]\/(.+?)(?:_\d)*?\/(.+?)\/(.+?)\/[chw]\/(?:(.+?)(?:\.(.+?)\.(.+?))?)?$<br />Is there a reason I'm not seeing as to why we shouldn't include these variables in those locations?<br /><br />also, i appologize for continuing to comment in your older posts - I didn't think this would have made too much sense in your later posts.Unknownhttps://www.blogger.com/profile/11724300872535035532noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-73141400255558276202010-03-30T11:14:57.132-07:002010-03-30T11:14:57.132-07:00hah, I hadn't either - until 4 people rushed m...hah, I hadn't either - until 4 people rushed my cube and asked why I broke our development environment!<br /><br />Thanks for everything. It's been immensely helpful.Unknownhttps://www.blogger.com/profile/11724300872535035532noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-31226936553121858482010-03-30T10:53:06.194-07:002010-03-30T10:53:06.194-07:00@Paul. Brilliant use of the tools! I did not try m...@Paul. Brilliant use of the tools! I did not try my regular expression on IE, only Firefox. I apologize. Thank you for pointing that out.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.com