tag:blogger.com,1999:blog-5472436831307966815.post3530694731087063676..comments2024-03-20T00:30:07.883-06:00Comments on Daniel Cai's Blog: CRM 2011: Get the Right Server URL in Your CRM Client ScriptDaniel Caihttp://www.blogger.com/profile/05461949321689249420noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-5472436831307966815.post-77225283071921420802014-04-03T05:00:50.500-06:002014-04-03T05:00:50.500-06:00very helpful post for me
mysql servicesvery helpful post for me<br /><br /><br /><a href="http://linkssol.com/" rel="nofollow">mysql services</a><br />Anonymoushttps://www.blogger.com/profile/07336715691357010427noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-54809132183573816862013-08-16T01:36:35.731-06:002013-08-16T01:36:35.731-06:00I have a Dynamics instance with a custom host head...I have a Dynamics instance with a custom host header, and my REST calls were failing, so I replaced getServerUrl(); with "/" + Xrm.Page.context.getOrgUniqueName(); and it works great. <br /><br />The URL is relative then, which seems to work fine as Adrii points out. <br /><br />I do all my calls from the CRM page, not any custom pages that use the ClientGlobalContext.js.aspx which apparently doesn't work (see posting above..)Dutchhttps://www.blogger.com/profile/04307239738989738473noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-44169258263574291262013-03-07T20:15:10.844-07:002013-03-07T20:15:10.844-07:00That's strange, can you check what you get aft...That's strange, can you check what you get after calling the method? Do you see a different server name?Daniel Caihttps://www.blogger.com/profile/05461949321689249420noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-3618719241032754892013-03-07T17:27:40.203-07:002013-03-07T17:27:40.203-07:00Hi Daniel,
In my case it doesn't work but I t...Hi Daniel,<br /><br />In my case it doesn't work but I think there is a problem with the configuration. <br />This is a CRM 2011 RU11 and I have configured to access by https. <br />I have 3 different ways to access:<br />1.-Within the LAN<br />If I type https://servername there is no problem, but if I type the IP adrress instead the name of the server, the access denied error appears.<br />2.-By internet<br />https://crm.domain-name.com I obtain the access denied error too. I have not configured the enviroment as an IFD.<br /><br />In all the cases before entering to CRM system a certificate error appears.<br /><br />I hope you can help me.<br /><br />Regards<br /><br />Anonymoushttps://www.blogger.com/profile/09775306358462509970noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-29639243125988114582012-05-16T13:26:59.541-06:002012-05-16T13:26:59.541-06:00prependOrgName will return empty string when using...prependOrgName will return empty string when using the context from ClientGlobalContext.js.aspx and not from CRM form.<br />I believe because the IS_PATHBASEDURLS variable is not defined in the ClientGlobalContext.js.aspx, and this is needed in prependOrgName function.CRM Testhttps://www.blogger.com/profile/00164289787318619027noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-84821882701064092872012-02-24T20:16:33.304-07:002012-02-24T20:16:33.304-07:00Hey, Andrii. You are right, perpendOrgName works f...Hey, Andrii. You are right, perpendOrgName works for offline client, hopefully it works for CRM online and IFD deployment (I don't have an environment to verify either of them). <br /><br />Just one minor note, it's Xrm.Page.context.prependOrgName, I was trapped by Xrm.Page.prependOrgName. ;-)<br /><br />During my testing, I realized, CRM returns http://localhost:2525 instead of the base server URL when getServerUrl() function is called for offline client. So I have updated my post to reflect this. <br /><br />Thanks for your tips, see you at the summit.Daniel Caihttps://www.blogger.com/profile/05461949321689249420noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-62288473010935989332012-02-24T08:57:01.544-07:002012-02-24T08:57:01.544-07:00Yes, I use it in my code. Should work without issu...Yes, I use it in my code. Should work without issues.<br />Offtopic - see you in 3 days ;)Anonymoushttps://www.blogger.com/profile/03225186683208658482noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-22258208556939905522012-02-24T08:54:56.775-07:002012-02-24T08:54:56.775-07:00So you would do this way?
var odataEndpointUrl =...So you would do this way? <br /><br />var odataEndpointUrl = Xrm.Page.prependOrgName("/XRMServices/2011/OrganizationData.svc");Daniel Caihttps://www.blogger.com/profile/05461949321689249420noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-85504942833330685432012-02-24T08:51:26.554-07:002012-02-24T08:51:26.554-07:00It should work without issue. I've noticed tha...It should work without issue. I've noticed that getServerUrl can create a lot of issues that's why I use relative urls in JavaScript that I develop.Anonymoushttps://www.blogger.com/profile/03225186683208658482noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-10086817757458717482012-02-24T08:38:25.363-07:002012-02-24T08:38:25.363-07:00Hi Andrii, if you construct url that way, you migh...Hi Andrii, if you construct url that way, you might have trouble with CRM offline client, although I haven't confirmed if that's the case. The goal of my post is to replace CRM getServerUrl function, since that's widely used in the CRM development practice, and it's causing a lot of trouble.Daniel Caihttps://www.blogger.com/profile/05461949321689249420noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-75916551306355799842012-02-24T03:19:41.506-07:002012-02-24T03:19:41.506-07:00Hello Daniel,
Why not to use relative urls like
va...Hello Daniel,<br />Why not to use relative urls like<br />var url = Xrm.Page.prependOrgName("Your Url");?Anonymoushttps://www.blogger.com/profile/03225186683208658482noreply@blogger.com