- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 12:59 PM
Hello,
I am looking to update work notes with a dynamic link. With the link it will be dynamic based off of another field. We track Fedex shipping numbers in a specific field on the RITM and when it is populated it adds a work note to the INC that with that tracking number but I would like it to also be a link to FedEx with that tracking number. I have come up with the script below but it is not working as a HTML link and Im not sure whats missing or how to fix
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2023 10:02 AM
Oh yup! I see it. You have a semicolon at the end of line 5, which terminates the statement. Instead of having a semicolon, you need to have a plus sign and move the following line up but in quotes. Like this:
incGR.work_notes = current.cat_item.name + " has shipped. Tracking #: " + current.getValue("u_tracking_send") + "[code]<a href='https://www.fedex.com/fedextrack/?trknbr=" + current.getValue("u_tracking_send") + "'>" + current.getValue("u_tracking_send") + "</a>[/code]";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2023 10:02 AM
Oh yup! I see it. You have a semicolon at the end of line 5, which terminates the statement. Instead of having a semicolon, you need to have a plus sign and move the following line up but in quotes. Like this:
incGR.work_notes = current.cat_item.name + " has shipped. Tracking #: " + current.getValue("u_tracking_send") + "[code]<a href='https://www.fedex.com/fedextrack/?trknbr=" + current.getValue("u_tracking_send") + "'>" + current.getValue("u_tracking_send") + "</a>[/code]";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2023 09:56 AM
@Aylee Andersen THANK YOU VERY MUCH! You were very helpful, I did "Accept As Solution" but had one more question, do you know how I can make the link open in a new window? It currently tries to open in ServiceNow but obviously its not a ServiceNow link.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2023 10:35 AM
@Dillin Bradley
Awesome! Glad I could help! All you have to do is add "target='_blank'" to your anchor tag and that should get you what you want. Here is a revised section of the line of code:
........<a href='https://www.fedex.com/fedextrack/?trknbr=" + current.getValue("u_tracking_send") + "' target='_blank'>" + .......