tag:blogger.com,1999:blog-34020393.post1851448988138045099..comments2024-03-27T10:59:38.307-07:00Comments on Jim's PeopleSoft Journal: Posting Data to IScriptsJim Marionhttp://www.blogger.com/profile/12995110203807924786noreply@blogger.comBlogger44125tag:blogger.com,1999:blog-34020393.post-74813899004629423482019-06-05T14:10:34.648-07:002019-06-05T14:10:34.648-07:00Hi Jim,
I'm fairly new to Javascript. I'm...Hi Jim,<br /><br />I'm fairly new to Javascript. I'm trying to write a javascript(Portal) using Ajaxrequest to call an Peoplecode Iscript(which is base instance) that updates the database and just returns a null String value.<br /><br /><br />I tried different ways and none of them are working. I couldn't even call my Iscript. Could you please help on this?<br /><br />var URL_PATH = https://Portal_URL/Record.ISCRIPT.Fieldformula.Iscript_test;<br /><br />function sendXYZAjaxRequest(url) {<br />loader = new net2.ContentLoader(url,null, null, "GET", function() {<br /> var respData = this.req.responseText; <br /> }, null, null, "application/x-www-form-urlencoded");<br /> // loader = null;<br />//window.location = respData; <br />}<br /><br />sendXYZAjaxRequest(URL_PATH);<br />==================================<br />2nd way- <br /> SSCHK= {}; SSCHK.xyzcheck= function () {<br />iAjaxRequest("GET", PU_SSS, function (o) {<br /> var pu_content = iParseTargetContent(o);<br /> //var SSheck = document.getElementById('CREF_NAME_THAT Is created in HUB');<br />//alert("sun :" + o.responseText)<br />//alert(SSheck)<br /> SSheck.innerHTML = pu_content;<br /> });<br />}<br /><br />SSCHK.xyzcheck();<br />============================================================<br /><br /><br />Thanks!Bartihttps://www.blogger.com/profile/06521199902464938078noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-2138248863126139422017-08-31T10:02:38.725-07:002017-08-31T10:02:38.725-07:00@Andytest2221, perfect. The general rule is to use...@Andytest2221, perfect. The general rule is to use Async unless you have to use sync. The reason is because Async can queue and allows for better resource balancing. Connection established, payload delivered, connection dropped. As you noted, however, sending a response is tricky. Async works best when no response is expected. If a response is expected, then there are two approaches:<br /><br />1. Initiator includes a callback URL with transaction ID or something. When process completes, your process invokes that callback to deliver response.<br /><br />2. Initiator periodically polls your PeopleSoft system to determine status and pick up a response if one exists.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-82867523932544505542017-08-31T08:30:54.639-07:002017-08-31T08:30:54.639-07:00Thanks, Jim.
I left that open as an option, but I...Thanks, Jim. <br />I left that open as an option, but I also started going down a different path. Instead of using an iScript, I created a web service. <br />When I use an application class handler for the web service, it allows me to do a Commitwork and I was able to get around the open cursor issue that way.<br /><br />My other concern with using the iScript was that during a system outage/production upgrade, the third party wouldn't be able to hit the URL, and we would lose those transactions. <br /><br />So, to try to resolve both issues, I created an async request/response service operation so that the transactions queue during an outage.<br /><br />But I'm a little skeptical of this solution. Most of the service operations for third-party integration that I've worked with (such as third-party vendors in ePro) are synchronous. I don't know that the third-party needs a response at all, and the order in which messages are processed don't matter. Is there anything wrong with creating it as async?<br /><br />Also, I'm unsure of how to return a response message with an async operation because the available handler types (on request, on notify, etc.) change depending on the operation type.<br />For example, for synchronous ops I can use OnRequest, and the IRequestHandler interface returns a Message.<br />But for async, I'm not sure what to use. I've been using On Notify, which doesn't return anything. <br /><br /><br /><br /><br /><br /><br />Andytest2221https://www.blogger.com/profile/03456165052251306745noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-68879960697727495032017-08-28T11:18:47.531-07:002017-08-28T11:18:47.531-07:00@Andytest2221, I think you are going to have to ge...@Andytest2221, I think you are going to have to get the remote call outside of the iScript processing. The only way I can think of to do that is to use the process scheduler. IB Full Syncs use a similar strategy.<br /><br />If you expect multiple hits per day, then you may want to schedule the App Engine and have it mark the rows you are processing with the Process instance or copy from a staging table into the table the Cobol will process. If there is a potential for data conflicts, perhaps there is a flag that tells the next scheduled instance to skip if the current one is still processing, etc.<br />Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-4347605047545226092017-08-28T09:59:14.200-07:002017-08-28T09:59:14.200-07:00Jim,
I am able to successfully post data to an iSc...Jim,<br />I am able to successfully post data to an iScript. But I also want the iSCript to insert a row into a table, and remote call a Cobol that will use the inserted row.<br /><br />Remote call is a think-time function so it errors because my cursor is still open from the SQLExec. <br /><br />I tried Commitwork and SQLExec Commit, and neither worked.<br /><br />I'm trying to avoid using the process scheduler because this iScript could be hit dozens of times a day. <br /><br />Any ideas?Andytest2221https://www.blogger.com/profile/03456165052251306745noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-69506525246626505782016-12-07T23:38:31.597-08:002016-12-07T23:38:31.597-08:00I just want to say "Many thanks"..This p...I just want to say "Many thanks"..This postDataBin=y helps..PeopleSoft HCM Dev Bloghttps://www.blogger.com/profile/07715136974710155902noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-73170220877658894272016-09-22T09:42:21.926-07:002016-09-22T09:42:21.926-07:00@Giridharan, I think I'm misunderstanding some...@Giridharan, I think I'm misunderstanding something. %Response.Write is used to send data to a browser. So you could use %Response.Write with an iScript IF the third-party has an authenticated session and is fetching data from PeopleSoft. That is not usually the case, however. It sounds like you want to send data to a third party (POST). In that case, you would not use %Response.Write, you would use %IntBroker.ConnectorRequestURL or some other Integration Broker mechanism to send data to a third party.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-2774012571546556592016-09-21T20:44:11.341-07:002016-09-21T20:44:11.341-07:00Hi Jim,
I am trying to post an encoded artifact f...Hi Jim,<br /><br />I am trying to post an encoded artifact from peoplesoft to thirdparty url via iScript using %response.write(); From the third party i am unable to get the response (return values) to peoplesoft. How to achieve this. Please advise.<br /><br />For achieving this. i have followed the following steps.<br /><br />Created a HTML object. the code in HTML is as follows<br /><br /><br />form target="_self" method="post" action="%BIND(:1)"<br />input type="hidden" name="eID" value="%BIND(:2)"<br /><br /><br /><br />The iscript coding is as follows<br /><br />&sHTML = GetHTMLText(HTML.A_TEST, &URL, &eID);<br /> <br /> &values = %Response.Write(&sHTML);<br /><br />How to retrieve the return values from third party?Anonymoushttps://www.blogger.com/profile/10685220344245630851noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-12183341513014431182014-01-17T09:06:49.934-08:002014-01-17T09:06:49.934-08:00@Chandra, I'm assuming you already considered ...@Chandra, I'm assuming you already considered adding the links to the email template? Other than that, modifying the code is the only other way I know of to add links to an email template.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-77964109431233350962014-01-16T08:34:07.345-08:002014-01-16T08:34:07.345-08:00Jim,
I have posted the questions yesterday, someh...Jim,<br /><br />I have posted the questions yesterday, somehow, i am unable to locate your answer.I re-posting it.<br /><br />We have requirement to change email link generated in emails for AWE via Generic templates. Per your previous blog post, I have looked at<br />EOAW_CORE.DEFN.AWTxn. Looks like it is generating the code somewhere there. However, without changing delivered code, is there anyway to achieve the links in the email.<br /><br />Thanks,<br />ChandraChandrahttps://www.blogger.com/profile/13527624177252786661noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-693399479950435282013-12-27T06:48:18.914-08:002013-12-27T06:48:18.914-08:00@Hemanth, I suggest you look into jQuery and Ajax....@Hemanth, I suggest you look into jQuery and Ajax. Ajax is the design pattern that will help you refresh your page content dynamically. jQuery is a JavaScript library that makes Ajax easier.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-46928293640514132622013-12-24T15:54:25.705-08:002013-12-24T15:54:25.705-08:00Hi Jim,
Its a wonderful journey of thoughts and s...Hi Jim,<br /><br />Its a wonderful journey of thoughts and shares helped to me to work on iscripts. <br />Now I would like to achieve<br />to refresh the iscript dynamically without page refresh and display related alert to referring iframe template based on page field condition.<br />Thanks,<br />Hemanth.Anonymoushttps://www.blogger.com/profile/17030717807520709102noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-26238288629782015212013-11-18T08:24:45.769-08:002013-11-18T08:24:45.769-08:00@Hemanth, you may need consulting assistance with ...@Hemanth, you may need consulting assistance with this.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-49114671697236136792013-11-16T18:04:22.183-08:002013-11-16T18:04:22.183-08:00Hi Jim,
I need help on Iscripts
I have a require...Hi Jim,<br /><br />I need help on Iscripts<br /><br />I have a requirement where I have to post the data to Iscripts on condition.<br /><br />For instance<br /><br />1)If an order has hold on header data should be posted to iscript and should be<br />displayed.<br /><br />Please let me know If you any questionshemanth kumarhttps://www.blogger.com/profile/10603922541809194141noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-72758484771309159282012-05-22T22:01:04.536-07:002012-05-22T22:01:04.536-07:00@Frank, I am very glad you found it helpful!@Frank, I am very glad you found it helpful!Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-22718878185141469372012-05-22T16:34:22.777-07:002012-05-22T16:34:22.777-07:00Jim:
Thanks for this gem of an insight! This hel...Jim:<br /><br />Thanks for this gem of an insight! This helped us make a major breakthrough on some things we're working on at BYU.<br /><br />Frank StaheliFrank Stahelihttps://www.blogger.com/profile/01822334061980912687noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-2600698270311277772011-12-06T12:56:39.626-08:002011-12-06T12:56:39.626-08:00@James, iScripts require an authenticated session....@James, iScripts require an authenticated session. Without a PS_TOKEN cookie, it is impossible to execute an iScript. There are several ways around this, and it really depends on what you are trying to accomplish. For example, if all of these iScripts are guest services, then you can set the guest user information in your web profile. Another solution would be to use some type of sso/ticket with another security provider (like one of Oracle's identity products) so that the user is automatically authenticated.<br /><br />Since you just need a PS_TOKEN cookie generated in the same domain as your PeopleSoft web profile's AuthTokenDomain, you can even have the non-PeopleSoft application make an HTTP request into PeopleSoft's signon page with some generic credentials, and then write the cookie back to the client (along with any other PS cookies that seem appropriate see <a href="http://jjmpsj.blogspot.com/2008/07/generating-authtoken-for-switchuser.html" rel="nofollow">Generating an AuthToken for SwitchUser</a> for a sample Java program that creates a PS_TOKEN).<br /><br />An alternative to iScripts is to use Integration Broker's HttpListeningConnector. With this alternative, you convert your iScript PeopleCode to an IB OnRequest handler and make HTTP GET/POST requests through the IB Gateway. My <a href="http://jjmpsj.blogspot.com/2011/10/rest-like-peoplesoft-services.html" rel="nofollow">REST-like PeopleSoft Services</a> post uses the same concept. It is this alternate approach that I recommend. Using Integration Broker for non-PeopleSoft requests gives you a lot of architecture flexibility.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-70971773794025898052011-12-02T10:26:26.845-08:002011-12-02T10:26:26.845-08:00Jim,
I have an external website where I would lik...Jim,<br /><br />I have an external website where I would like to consume an iScript that was created. I keep getting "Security Authorization errors", or PeopleSoft delivered signin screens. I imagine there should be a way to "deep link" into an iScript to expose it to an external webpage without having to login to PeopleSoft. Do you know if this is possible? If so, do you know how I go about doing this?<br /><br />Thanks,<br /><br />James BJameshttps://www.blogger.com/profile/08179822315495021148noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-33373574756992478342011-06-06T10:46:57.397-07:002011-06-06T10:46:57.397-07:00@VirtualMadman,
Getting the app server name is pr...@VirtualMadman,<br /><br />Getting the app server name is pretty easy because your PeopleCode runs at the app server. Likewise, when the app server connects to the database (Oracle DB, at least, not sure about MSFT), the database keeps the name of the server that connected (client). In Oracle, you can see this in v$session, and you can use one of the SYS_CONTEXT variables to determine the client name. If you have the app server name in an environment variable, then you can use the <a href="http://download.oracle.com/docs/cd/E18083_01/pt851pbr0/eng/psbooks/tpcl/htm/tpcl02.htm#4aa6e529_12cf5dc4902__3bbb" rel="nofollow">GetEnv</a> function to get the value of an environment variable. If you have a shell program (for example, Unix/Linux, etc), then you can exec a shell program and get output using Java (see <a href="http://jjmpsj.blogspot.com/2010/02/exec-processes-while-controlling-stdin.html" rel="nofollow">Exec Processes while Controlling stdin and stdout</a>.<br /><br />The web server is a different story. There may be a way to get the web server info, but it isn't exposed through PeopleCode. Basically, if it isn't in the Request object as a header, then it isn't available. If you don't have an existing header that satisfies your needs, then you can add one by using a ServletFilter. I have an example of a ServletFilter that adds a header in my post <a href="http://jjmpsj.blogspot.com/2007/11/desktop-integrated-signon.html" rel="nofollow">Desktop Integrated Signon</a>.<br /><br />About "Ask Jim..." I have definitely given that some thought, but haven't come up with a way to do that yet.<br /><br />I refer back to my book regularly. I am glad that you find it useful as well.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-89097734538031367892011-06-03T18:35:23.332-07:002011-06-03T18:35:23.332-07:00Hi Jim,
I googled my way into this post trying to...Hi Jim,<br /><br />I googled my way into this post trying to find a way to capture the web server name through peoplecode. Since there is no "Ask Jim" section in your blog, I thought I would just post it here as a comment.<br /><br />Basically I'm trying to print debug code as HTML comments that would display the App server and web server used in each request. We have several web servers behind a load balancer and just printing the domain name (%Request.ServerName) would not resolve our issue.<br /><br />Do you know if there is a way to do this?<br /><br />Thanks for the help and great job on the book!<br /><br />-Eduardo MonteiroVirtualMadmanhttps://www.blogger.com/profile/03914297786202325633noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-8485296482831412352011-04-26T08:46:50.414-07:002011-04-26T08:46:50.414-07:00@KK, Enterprise Portal's Role based branding i...@KK, Enterprise Portal's Role based branding is an app class that overrides the core PeopleTools PT_BRANDING:BrandingBase App class. What you could do is create a new app class that subclasses PT_BRANDING:BrandingBase and implements the functionality you desire. When you are finished, go to PeopleTools > Utilities > Administration > PeopleTools Options and change the Branding App Package and Class to match your new package and class.<br /><br />Note: Even though this is a configuration and you have not modified any delivered objects, you may need to rework your custom branding package after upgrades. The PT_BRANDING:BrandingBase interface is subject to change.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-28733456292791071922011-04-26T07:24:09.704-07:002011-04-26T07:24:09.704-07:00Jim,
I am trying to replace the homepage with a cu...Jim,<br />I am trying to replace the homepage with a custom html object for one user and i dont have enterprise portal license in my application to do branding based on role. How I can acheive this?<br /><br />Thanks,<br />KKKKhttps://www.blogger.com/profile/11152978606482287885noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-41990958453963309882011-04-25T14:16:18.697-07:002011-04-25T14:16:18.697-07:00@KK, "... for one user..." Yes, of cours...@KK, "... for one user..." Yes, of course, anything is possible :).<br /><br />It really depends on how dramatic your change. If you want a full layout change, then you will need something like Enterprise Portal's role based branding. If it is a minor change, then you can get by with just some JavaScript/HTML in a pagelet.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-50008597689645031302011-04-25T14:14:15.641-07:002011-04-25T14:14:15.641-07:00Jim,
Yes, I mean the URL ending in ?tab=DEFAULT?. ...Jim,<br />Yes, I mean the URL ending in ?tab=DEFAULT?. but changing the attibute values changes for all the users. I want to change the home page for only one user. Is that possible?KKhttps://www.blogger.com/profile/11152978606482287885noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-72213099807268475562011-04-25T12:03:22.650-07:002011-04-25T12:03:22.650-07:00@KK, do you mean the one with a URL ending in ?tab...@KK, do you mean the one with a URL ending in ?tab=DEFAULT? The HTML for that is in App Designer. In fact, a homepage tab is a composition of several HTML definitions, all prefixed with PORTAL_HP. The recommended way to change these values is to create attributes on the homepage tab CREF in structure and content. The attribute name is the original HTML definition name, and the value is the new HTML definition name (likely a clone of the original).Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.com