Notifications
Announcements
No record found.
Is there anyway, that I can disable or stop the prefix "http://" from being added to the website field with the URL format? Thanks.
*This post is locked for comments
any help please?
call below function in onload of the form that will remove http from the url. THis will work only when user update/add value to website field. if you want to remove for exisitng record i uggest you to bulk update using export to excel.
function removeHttp() {
var website = Xrm.Page.getAttribute("websiteurl");
if (website)
{
website.addOnChange(function () {
var url = Xrm.Page.getAttribute("websiteurl").getValue();
if (url && url.indexOf("http") > -1) {
Xrm.Page.getAttribute("websiteurl").setValue(url.replace("http://", ""));
}
});
It doesn't work.
I tried An other solution: I applied the function removeHttp on the OnSave event of the form. The websiteurl field is saved without the http but when opening the account form, it always shows the http before the website url, even it saved without it.
the URL format is a special one, a protocol must be specified and if it is missing or not a valid one, http:// is always added.
allowed protocols are
HTTP, HTTPS, FTP , FTPS, ONENOTE and TEL
msdn: technet.microsoft.com/.../dn531187.aspx
Thank you.
So, what I can do is to create a text field that replace the website url field. Is there a way to make the text field clickable (and blue if possible) ?
not using a supported customization, you need to create a custom webresource binded to your simple text field in order to create the hyperlink
I tested this in my online as well on-premise crm and it works all the time. It will remove "http://" from records that are created newly or website field value changed. If you want to make the change for all existing record export the records into excel and remove the http:// and re-import it to crm.
It doesn't work Chitrarasan. I tried your solution many times.
The explanation of Guido helped me but doesn't give the solution.
The weird thing is this url field prefix always updating whenever the form loaded. It is happening even for read only forms (inactive) and asking permission to save it before exiting.
Is anyone got a fix for this?
Yes, it is annoying that Microsoft added this functionality. Put this in your form's script (I put it at the top outside of my on_load). It will override the function used by CRM so that the URL doesn't get modified. Because Microsoft can, and does, change non-sdk object model in cloud tenants without letting anyone know, you should be aware this function could change so that the override no longer works...solves the problem for now though.
parent.validateUrlProtocol = function () { return 1;}
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2