What I'm trying to do is to send out an formatted email upon a workflow transition that has a hyperlink in it. My script to send the email is calling an Advanced Print View (APV) that I've created that is a email template that I call from the script. The script calling the APV works fine. What doesn't work is the hyperlink within the APV.
The hyperlink I want to display is the URL to a PLM record in the email, thus the dmsID of the record must be a variable and inserted into the href string. This is where the problems begin... Now in my records I store the dmsID in a field for each record. In my APV html code I try and call that field and retrieve its value, but once I enter the code into the editor and press the update button it reformats and removes a portion of the code and when i try to run it it errors with the mystery man.
Below are a few screen shots of my code...this shows what I started with and what I thought would work...
This image shows the reformatting i get when saving the #3 set of code above...
The next two images show #1 above and #2 above the results...
Now the above result is what I want, but remember this using using code that hardcodes the dmsid value and this value needs to be a variable.
Is this possible? If so, how might I go about doing this?
I hope this all makes sense.
Thank you,
John
Solved! Go to Solution.
Solved by tony.mandatori. Go to Solution.
I think you are trying to generate the link in the Advanced Preview...
Instead, try adding the link after loading the APV.
var plmtenant = "https://mytenant.autodeskplm360.net";
var tenant = plmtenant+"/workspace#workspaceid="+wsId+"&dmsid="+itemDmsid+"&tab=";
var tab = "itemdetails";
....
email.body = getPrintView(avp);
email.body += '<br><br><a href="'+tenant+tab+'">View Items details for '+subject+'</a></br></br>';
....
Does that work?
Thanks,
Tony
Yes Tony, that does work! Thank you!
However, aesthetically its a bit ugly (I know I can format the text). I really want to know if the hyperlink can be done like this within the APV template that I'm calling? Is it possible? See image below...
Thanks again!
JD
Can't find what you're looking for? Ask the community or share your knowledge.