web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

URL String - assign both visible text and URL hyperlink value on Account Form

(0) ShareShare
ReportReport
Posted on by 155

I've added a field to the Account entity to store a URL string. It's formatted as a "Single Line of Text" with format type "URL." I then use JaveScript and the OnFormLoad event to calculate and populate this with a value, navigating to a web address that is rather cumbersome.

The URL address appears on the Account form correctly,
but I'd rather my users only see a hyper-linked text value which reads "Click Here" and not the URL itself.

What is the best way to perform this update?

In other words, how can I programmatically provide both the URL source and the visible text for a URL text field on a CRM Account form?

Thank Scott

Further Context:
How I assign the URL value in js:

var NewFieldUrl = Xrm.Page.data.entity.attributes.get("new_MyNewField");
var url = "https://long.crazy.url.that.I.would.like.my.users.never.to.see.com/moredatatohide" + otherData;
NewFieldUrl .setValue(url);

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    jlattimer Profile Picture
    24,562 on at

    You could set the field as you do now but hide it on the form. Then create an HTML web resource which reads the Url value from the field and constructs an <a> tag with what ever text you wish to display. Embed the HTML web resource on the form and you are in business and supported.

    I'm under the assumption is you don't want the users to see the actual value they don't have edit permission on the field. so you would on'y need to make it visible for those who can actually edit it and see the Url. 

  • Varun Singh Profile Picture
    943 on at

    Hi Scott,

    Have you got some solution for this. To set text and URL value for Text URL field. If yes please share it because I wanted to do same thing.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans