can anyone help me on creating a hyperlink? it red...
# suitescript
v
can anyone help me on creating a hyperlink? it redirects to the record page so at the end of the url i want to add recordId.
b
what does your attempt look like
v
i am sending an email to the customer after the final payment. on that mail i want to have a hyperlink to open the record page.
b
still doesnt tell me what the code is
v
email.send({ author : senderId, recipients : recipients, body : No approval was triggered since they are processed.' +' Please click this ' + "<a href= 'link'" + link + ">" + "</a>" subject : subj})
this is my code
j
Missing a ' before No approval?
I recommend creating a variable for the body.
c
Are you just asking for the url to a specific record?
v
My actual requirement is creating a hyperlink
without the hyperlink the code works very well.
b
use url.resolveDomain and url.resolveRecord to generate the link
v
both should i use?
b
you will learn the answer after trying
c
@vennila ramasamy Are you using the help center to see how the methods in each module work? Find the "N/url Module" page in the help center, and there are links for both methods explaing what they do, what arguments they take, what they return, etc. There's also a good example on that page of how to build the full URL to a record.
v
@battk thank you , now got it
on the return string i want to remove some characters at the end of the url. what should i do?
@Corey Schwoebel yes got it , than kyou
in my code if i click on the word 'link', it should redirect to the page. so should i use this in <a href>?
c
Correct. You might have to piece the url together similar to your example
v
ok thank you.
i got the url from the resolveDomain(), resolveRecord. I want to remove some characters at the end of the url. How can that be achieved?
b
usually you wouldnt want to mess with the url netsuite generates for you
c
what exactly are you trying to change in the url?
b
you would be better off generating the url on your own if you plan on changing it
leave it, it allows netsuite to redirect if the domain is incorrect
v
Yes yay;;;; It works
@battk thank you
how can i make this link as a hyperlink?
b
v
it returns unexpected error
b
what code is throwing the error
v
var link = <a href = "concatenatedLink">concatenatedLink</a>
this is where it throws the error
j
var link = ‘<a href = \“’ + concatenatedLink + ‘\“>’ + concatenatedLink + ‘</a>’;
Let me know if that works. I think the issue was the ” wasn’t escaped.
v
@Jamie Houselog it works with this '<a href = "' + concatenatedLink + '">' + 'link' + '</a>'
👍 1