Is there an OOTB action that allows accessing external web applications from Pega via a link?
A button in a section needs to open a new browser tab/window with a predefined link for an external application. The "policy number" of the current case needs to be inserted into the URL so that the policy currently being viewed in Pega is opened in the external system.
Does Pega have OOTB functionality to do this?
I do have an example from a previous application (see screenshot) that uses an action set with a "Run script" action. This is the script:
function OpenInP2000(P2000URL, PolicyID, Mode){
if(Mode == "Policy") Mode = "";
window.open(P2000URL + PolicyID + "/" + Mode);
}
In the interest of improved maintainability for the customer, I wonder if Pega offers something like this that wouldn't require the use of a script.
Thanks!
***Moderator Edit: Vidyaranjan | Updated Categories***
-
Like (0)
-
Accepted Solution
I was able to solve this with a data transform as follows:
- Created a new property to store the URL: ".URLProperty" (not the actual name).
- On the Actions tab of the button that needs to open the URL, added a Refresh this section action to the existing Click event.
- Typed name of the new data transform into the data transform field ("FormURL") and hit the reticle icon to create and open it.
- Used Set on .URLProperty with a function call to Declare_EnvSettings.ServiceEndPoint(URLDomain) + .PolicyID
Works great. I had to use Refresh this section instead of simply adding a Data Transform action because the .URLProperty was not being set correctly. I don't know why.
Hi
i assume that you already know what will be the format of the URL so that it can open up the external application.
All you need to do is pass the policy ID in the URL.
To assist more on this, I would like to know how the URL will look like with Policy ID ? Can you please provide a sample URL ?
Hi.
Yes I have the format of the URL: https://X.com/randomstring/app/directaccess_flow?policy=Z
where X is just a string broken up by periods representing the address of the internal application and Z is simply an integer representing the policyID that needs to be used.
I'm currently trying to make sense of how to use the "Open URL in window" action set:
Open URL in window |
Using an activity that returns an HTML stream, opens a URL in a browser window. Action |
Hi.
Yes I have the format of the URL: https://X.com/randomstring/app/directaccess_flow?policy=Z
where X is just a string broken up by periods representing the address of the internal application and Z is simply an integer representing the policyID that needs to be used.
I'm currently trying to make sense of how to use the "Open URL in window" action set:
Open URL in window |
Using an activity that returns an HTML stream, opens a URL in a browser window. Action
|
I'm puzzled. See the screenshot. With that setup, the target application gives me the first line of this:
Policy PolicyID?policyid=00000012263010 is not found
I then removed the "PolicyID" at number 1 in the attached screenshot and get the following line:
Policy ?policyid=00000012263010 is not found
Then I removed the "policyid" from the PARAMETER column below the Alternate Domain URL field and get this somehow:
Policy 0000000000000? is not found
All I need is for the property .PolicyID to be inserted after the "=" of the URL in the Alternate Domain URL field.
Saw that but sadly it does not help because it only uses Alternate Domain URL simply and without multiple parameters for example. Sometimes I wish there were examples of all sorts of uses for various settings in Pega... I know of the UI Gallery, but it just scratches the surface.
Hi
Dont do the formation of the URL in the alternate domain field.
I would suggest you to take it to two steps
1. Use an activity to form your URL. In that activity you can refer the policy ID and use string fuction to concatenate and form a valid URL and store in a property
2. Then in the OpenURL In a window function , refer the property where you stored the URL . ( Use the down arrow key to refer the property )
Accepted Solution
I was able to solve this with a data transform as follows:
- Created a new property to store the URL: ".URLProperty" (not the actual name).
- On the Actions tab of the button that needs to open the URL, added a Refresh this section action to the existing Click event.
- Typed name of the new data transform into the data transform field ("FormURL") and hit the reticle icon to create and open it.
- Used Set on .URLProperty with a function call to Declare_EnvSettings.ServiceEndPoint(URLDomain) + .PolicyID
Works great. I had to use Refresh this section instead of simply adding a Data Transform action because the .URLProperty was not being set correctly. I don't know why.