Hello, I have a custom body field that contains a ...
# suitescript
a
Hello, I have a custom body field that contains a file id on a remote system. What I am trying to do is to covert this normal field into a URL the user can click, that will trigger a Suitelet to download the document with that id. Anyone has done this? Any suggestions? Thanks!!!
b
Your first attempt should probably be one field to hold the file id, and another field which is a link that uses a formula to generate the url you want to use
a
thanks
a formula?
what do you mean?
b
make a hyperlink custom field
See Creating Formula Fields to learn how to use a formula to default the link's url
a
thanks, will take a look
okay, I have created a new field on an user event script, type is INLINEHTML
I think this would work
I can add an anchor <a> tag
that can call a suitelet to do the download
I think it may work
it seems I cannot add a label to an INLINEHTML field… this is not good
do you know if it is possible?
b
you do your own html in an inline html field
add whatever elements are necessary to make it look how you want
a
oh, right, I guess I can add the label as well….
I will try that
b
keep in mind, that my recommendation remains to make a hyperlink custom field using the normal suitebuilder before trying to script it
a
why?
not to customize with scripts?
b
usually you want to identify why the native solution doesnt work for you before moving onto a scripted one
so far your requirements look like a hyperlink with a label, which is within the capabilities of a native hyperlink field
a
okay, thanks, that makes sense
in this case though, I will need scripting, at least a Suitelet to call the integration to retrieve that document. But maybe I would not need a User Event script to create the INLINEHTML fields... etc