- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 11:09 AM
Hello,
I relativley new and need some direction on how I would get a pdf document being retrieved from a different system via a url to open the specific form related to the record. Below is code I attached to a UI action button. However, I see there are various ways to do this and I am just not sure what the best option is for opening the PDF form. Does the code look right and/or, is there a better option to accomplish this?
var gsRecord;
var url = 'https://fn5digdev.mtb.com/navigator';
var desktop = 'BDA&';
var repository = 'Retail&';
var documentCME_ID = current.u_filenet_document_id;
var templateName = 'dcRetail&';
var version = 'release&';
var embedded = true;
function openURL() {
{
gsRecord = ('url' + 'desktop' + 'respository' + 'documentCME_ID' + 'templateName' + 'version' + 'embedded');
action.setRedirectURL(url);
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 09:26 AM
Hi @Harsh Vardhan - I found that and tried what you attached for the regex for removal of the curly brackets and the curly brackets were not removed. However, I may no longer need them removed, so I believe I am all set and appreciate all of the help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 01:01 PM
Try using below script.
function onClick(g_form) {
var documentCME_ID = g_form.getValue('u_filenet_document_id');
var url = 'https://fn5digdev.mtb.com/navigator/bookmark.jsp?desktop=BDA&repositoryId=Retail&docid=%7b' + documentCME_ID + 'template_name=dcRetail&version=released&embedded=true';
//https://fn5digdev.mtb.com/navigator/bookmark.jsp?desktop=BDA&repositoryId=Retail&docid=%7b18488797-B...';
open(url);
}
Working example.
function onClick(g_form) {
open('https://www.google.com/');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 01:02 PM
@Annette Kitzmil Also set "Client" checkbox true on your UI Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 06:30 AM
Hi @Harsh Vardhan - So I added the script below to the workspace section of my UI Action and changed the Client Script checkbox to true.
Then I added the other script to the Client Script and now when I click the Open Document button, it doesn't do anything. If I remove the check for the Client Script it reverts back to the previous behavior and just reloads the old page instead of the pdf attachment. I am hoping that I made the updates correctly which is why I am letting you know what I did. I appreciate the help you have given me so far.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 06:55 AM
Hi @Annette Kitzmil : I would suggest try with simple script to check if it open in new window. i tested at my end with below script and it worked.
function onClick(g_form) {
open('https://www.google.com/');
}
If this script worked and redirect to google page then try with your script by hardcoding the url to see if it works or not?
This way you can troubleshoot this.
If possible please share screenshot of latest configuration you made on UI Action.
Thanks,
Harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 07:02 AM
Hi @Harsh Vardhan - So am I just adding the above script to the UI Action which also matches what I have on the Client Script to troubleshoot this?
