UPS Hyperlink in invoice e-mail APR

It’s my understanding that they added it in .500. We are still on .400 and our APR consultant said that those new features in in the .500 release.

I just wrote the code manually in the email template in the routing rule designer. It doesn’t look any different than earlier versions with the exception that you can select email format html or plain text.

Whoops … My bad. I was thinking about BPMs.

So typing the following (with the two <TrackingNumber/> parts as “Inerts”)

<a href="http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=<TrackingNumber/>"><TrackingNumber/><a/>

shows as (assume tracking number 12345)
http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=12345

When you want:
12345

whose url is
http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=12345

That correct?

That is correct, both tracking numbers are field inserts.

You are correct as to how I want it to show and it does show up correctly. However, the hyperlink’s url ends up being

http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=<TrackingNumber/>

rather than

http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=12345

I’m on 10.2.300 , which apparently does not allow HTML in the email widget of an APR. Yet you can put HTML in the email widget of a BPM (if you add the HTML framing)…

In a BPM email Widget, I can put


(the underlined parts were “inserts”

And get an email with:

image

The inserted callContext...Company gets expanded in my BPM’s email widget.

But in your APR email, it is treated as a literal (because inside the quotes, i’m guessing)

Can you post a screen shot of the Email widget design in your APR?

Here you go. Thanks for all the help so far! I’ve always gotten good info from here simply by searching and not having to ask a question myself. I didn’t realize HTML was so new to APR. We currently run Altec APM on 10.1.500.23 and this is the last piece of the puzzle before I pull the trigger on our upgrade. It’s not totally necessary, but I enjoy when vendors have a clickable tracking number, so why not do it. Of course I thought it was going to be easy because I assumed the widget was going to read my code like I wanted, but I was wrong. I thought it was going to be more like expressions in VB where you can have multiple levels of brackets, but I’m also not proficient in HTML.

It will actually format the url correctly if i don’t try to format it with HTML, but I don’t like the way it looks showing the entire URL.

In the body, the <a ... > HTML tag shows everything from a href...Number as underlined and blue. is that a field, or just typed text, that the editor is highlighting for you?

The fact that Epicor uses <fieldID/> as the place holder for inserted dynamic fields, really makes it difficult to determine what’s manually typed HTML tags, and which are inserted fields.

It’s typed text except for <TrackingNumber>, that’s a field. CustomerEmail and InvoiceNum are also fields. Once you close the editor and open it back up it turns it blue and underlined. Once it’s like that, you can’t edit it because it treats it like one unit like it does for an inserted field. Like you said, the way they have inserted fields formatted, it’s getting confused with what is HTML and what is a field.

1 Like

Did you ever get this figured out? I’m currently having a similar issued trying to embed a URL link in my email body for breaking and routing.

Thanks!

I’m having this same issue, on 10.2.700. If I’m making an HTML email, after inserting a field and closing out, upon reopening the inserted field doesn’t work anymore. I’m not even trying to embed it in link, just trying to insert a contact name. It works fine as plain text.

@balair Unfortunately the formatting of inserted fields makes adding them into any html tag, impossible (from what I’ve tried).

The best workaround I could find was to create a custom field (on whatever BO you’re printing on), and build out the full html a tag within that custom field.

1 Like

I reported the an html formatting bug to Epicor in June, it was fixed and to be released in Kinetic.
In Kinetic 2021.1.5 we can create HTML formatted emails. When we added fields using the Insert Fields option the formatting Epicor using for the fields breaks the html rendering.
TASK7119038
Maybe this helps you.

Did you ever try using escape codes for the manually typed < and > characters?

like:

&lt;a href="http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=<TrackingNumber/>"&gt;<TrackingNumber/>&lt;a/&gt;

(where <TrackingNumber> is the inserted field in the designer form.)

Fairly certain that won’t work, but worth a try.

My guess would be that the resulting body text would be

<a href="http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=12345">12345<a/>

And not actually be a link. But you never know…

Very good suggestion! However I just tried it and it came out like this:

So close!!!

I wonder if it has to do with the < and > characters (from the inserted field place holder) being nested within the <a..> tag

Try the following:


<a onclick="openTracker()"><TrackingNumber/><a/>

<script>
function openTracker() {
  window.open("http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=<TrackingNumber/>");
}
</script>

In the above, the <TrackingNumber> inserted field is never inside any one <...> tag

edit

using <a href="" onclick="openTracker()"><TrackingNumber/></a>
(the addition of href="") will make the text between the <a> and the </a> appear as a link (color and underline styles applied).

It 100% does. The formatting for the inputted fields from the insert button (on the E-Mail Template) are almost seen as part of the html tag. Before closing the email template, the a tag looks like this:

After opening it back up, it goes to this:

If only the field was formatted to something like ${Epicor_Field}

Can you have a <script> ...</script> section in those emails?

edit

maybe simpler than my prior use of an onclick() handler would be:



<a id="tn">12345</a>
<script>
var a = document.getElementById('tn');
a.href = "http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums="+'<TrackNum>';
</script>

Nope, I tried

</script>
document.getElementById("tNumATag").href="https://www.fedex.com/apps/fedextrack/?tracknumbers=" + <tNum/>
</script>

And also the script you posted with the onclick(). Both no results.

Wouldn’t be surprised if <script> sections was scrubbed out by either Epicor or your mail client (or both!) for security reasons.

If it is a BAQ report than use the method mentioned above, to make a calc field that builds the whol <a> ...</a> tag as a string

In the BAQ, a calc field of type string, with expression

'<a href=\"http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=\" + TrackingNumber.ToString() + '\">' + TrackingNumber.ToString() + '</a>'

Then when you insert that filed just have it by itself.

For me, I’m updating the tracking number with a REST call, from an asp.net web app.

I create the a tag in C# and patch it to the custom field created on the BO’s UD table

And then call that field directly using the insert button on the E-Mail Template.