CRM 2011 On Premise / http connection working / https connection not working

Hi

I created a ribbon button that calls a JavaScript function with several sections.  The button/JavaScript works when connected in-house to the CRM server using http - but when connected using https some parts of the function work but others do not.

The function fills in a quote with pre-selected values to enable the user to quickly populate a quote.  JavaScript that populates lookup values from systemuser works in both http and https - JavaScript that populates optionsets only work using an http connection.

I am confused by this and have tried reworking the code.  I have also checked the browser versions, security settings on the https browser but I am not making any progress.

Does someone have an idea of what could be causing this?

Thanks
LVL 1
apollo7Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Feridun KadirPrincipal ConsultantCommented:
The first thing to point out is that CRM does not support use of http and https bindings for the website at the same time (even though IIS does). You can either use http or https but not both.  

I'm not suggesting that this is definitely the cause of your problem but it might be and it is something that you should address in any case. Have you configured IFD (I'm guessing that you have given you have an https binding)?  If so, then you should remove the http binding and also ensure that the CRM web properties in Deployment manager are configured correctly.
0
apollo7Author Commented:
Here is what I have:   I have dev, test and production servers that I connect to using RDP.  I use Visual Studio on the CRM servers to develop code and SSRS reports.  In this environment, I use a http address (no certificate) when I open CRM 2011.

We also have an IFD that users and testers use to access CRM, this is an https address with a SSL certificate to provide security over the internet.

Is this configuration incorrect?  I was not involved in setting up CRM so I am not sure what was decided at the time.  Also, I have made numerous customizations, plugins, client side code, etc that work for both my dev environment and the IFD, this is the first change that works differently on the IFD and the internal CRM servers.

Thanks for your help.
0
apollo7Author Commented:
New development, I have all the fields populated from the IFD https address except the current user.  I am using ODATA and wonder if this could be the problem.  The user fields are also read-only so I tried setting diabled to false, populate code, then set back to disabled back to true.  This did not make a difference.

The code I am using to get and set the current user is below.  It works if I am on the CRM server but not logged in as an IFD user

function GetItcUser() {
    var context;
    var serverUrl;
    var UserID;
    var ODataPath;
    context = Xrm.Page.context;
    serverUrl = context.getServerUrl();
    UserID = context.getUserId();
    ODataPath = serverUrl + "/XRMServices/2011/OrganizationData.svc";
    var retrieveUserReq1 = new XMLHttpRequest();
    retrieveUserReq1.open("GET", ODataPath + "/SystemUserSet(guid'" + UserID + "')", true);
    retrieveUserReq1.setRequestHeader("Accept", "application/json");
    retrieveUserReq1.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    retrieveUserReq1.onreadystatechange = function () {
        retrieveUserReqCallBack(this);
    };
    retrieveUserReq1.send();
}
function retrieveUserReqCallBack(retrieveUserReq1) {
    if (retrieveUserReq1.readyState == 4 /* complete */) {

        if (retrieveUserReq1.status == 200) {
            var retrievedUser = this.parent.JSON.parse(retrieveUserReq1.responseText).d;
            if (retrievedUser.FullName != null)

                var setUservalue = new Array();
            setUservalue[0] = new Object();
            setUservalue[0].id = Xrm.Page.context.getUserId();
            setUservalue[0].entityType = 'systemuser';
            setUservalue[0].name = retrievedUser.FullName;
            Xrm.Page.ui.controls.get("csc_itcuser").setDisabled(false);
            Xrm.Page.getAttribute("csc_itcuser").setValue(setUservalue)
            Xrm.Page.getAttribute("csc_itcuser").setSubmitMode("always");
        }
    }
}

Open in new window

0
ON-DEMAND: 10 Easy Ways to Lose a Password

Learn about the methods that hackers use to lift real, working credentials from even the most security-savvy employees in this on-demand webinar. We cover the importance of multi-factor authentication and how these solutions can better protect your business!

Feridun KadirPrincipal ConsultantCommented:
Sorry for the delay. One thing you should do in your Javascript is change context.getServerUrl() to context.getClientUrl().  Microsoft removed getServerUrl in CRM 2013. This article has more details https://msdn.microsoft.com/library/gg334511(v=crm.5).aspx#BKMK_getServerUrl

With regard to your previous post regarding environments, the rule is for a single deployment (that is an installation of CRM, but possibly multiple databases), enabling http and https is not supported.  But if your environments are actually separate deployments, then each deployment can be different.  You mention servers in the plural so you might have several deployments, but it might also be that you several CRM servers within one deployment so I can't tell.

Correcting the JavaScript might do the trick.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
apollo7Author Commented:
Thanks,will give this a try
0
apollo7Author Commented:
Thanks for the syntax correct, needed that for the functions to run
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.