- 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-21-2023 01:20 PM
Hi @Annette Kitzmil - Your script will not work because you have passed your variable as an string also you dont need to define function :
eg: script should be something like
var documentCME_ID = current.u_filenet_document_id;
var url = 'https://fn5digdev.mtb.com/navigator/BDA&Retail&'+documentCME_ID+'dcRetail&release&true' ;
action.setRedirectURL(url);
I am assuming your url values are correct.
I will give you one example, you can validate with this script and it will work. same way you can configure based on your requirement.
var documentCME_ID = 'search';
var url = 'https://www.google.com/' + documentCME_ID + '?q=software';
action.setRedirectURL(url);
Hope it will help you.
Thanks,
Harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 08:49 AM
Thank you, this was very helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 09:13 AM - edited 08-22-2023 09:13 AM
@Annette Kitzmil Glad it helped.
If your queries has been solved, kindly Accept the solution and close this thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 10:21 AM
I need a little bit more help if you don't mind. Below is an example of the URL in red that wouldn't have the same docID that is shown in the var documentCME_ID. So I modified the code to reflect this example I got this AM, but it still isn't opening the document. If you see why, then please share, but if not, is there a way that I can get the URL to display to try and figure out why it is failing?
