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)

CRM 2011 --> 2013 "2007 web service endpoint"

(0) ShareShare
ReportReport
Posted on by

Googled this one extensively but not making much progress. Installed the Microsoft Custom Code Validation Tool for my CRM 2011 install. Ran it (both the 2013 custom code validation tool and the 2011) - but nothing appears in the three boxes.


When doing a test migration to 2013 from 2011, I received the following error during System Checks: "The JavaScript web resources in your system contain a reference to the Microsoft Dynamics CRM 4.0 (2007) Web service endpoint. The 2007 endpoints are not supported in this release." I went to the log file specified and received: "<Message>Web resource QuoteDetail_main_library.js contains a reference to the 2007 web service endpoint."</Message>

I went to that area in crm - text editor - and then get frozen in my tracks. I placed (removed) in for redacted info. As a sysadmin, not a programmer, do I have any chance of upgrading this? When migrating from 2007 to 2011, I was able to use a tool that auto-fixed items needing xrm.(whatever), but this seems more extensive.

function Form_onload()
{


Xrm.Page.getAttribute("(removed)_extendedamt").setValue(Xrm.Page.getAttribute("priceperunit").getValue() * Xrm.Page.getAttribute("quantity").getValue());







var _roles = ['Quote Restriction']; //array of security roles name

var _fields = ['productdescription','priceperunit','quantity','manualdiscountamount','(removed)_longdescrip_exp','isproductoverridden']; // array of field schema names to disable

UpdateFields();

/* Functions */

function UpdateFields() {

    var oXml = GetCurrentUserRoles();

    if (oXml != null) {

        var roles = oXml.selectNodes("//BusinessEntity/q1:name");

        if (roles != null) {

            for (i = 0; i < roles.length; i++) {

                for (j = 0; j < _roles.length; j++) {

                    if (roles[i].text == _roles[j]) {

                        for (k = 0; k < _fields.length; k++) {

                            try {

                                document.getElementById(_fields[k]).Disabled = true;

                            } catch (e) {

                            }

                        }

                        return;  

                    }

                }

            }

        }

    }

    return;

}

function GetCurrentUserRoles() {

    var xml = "" +

"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +

"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +

Xrm.Page.context.getAuthenticationHeader() +

" <soap:Body>" +

" <RetrieveMultiple xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" +

" <query xmlns:q1=\"http://schemas.microsoft.com/crm/2006/Query\" xsi:type=\"q1:QueryExpression\">" +

" <q1:EntityName>role</q1:EntityName>" +

" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +

" <q1:Attributes>" +

" <q1:Attribute>name</q1:Attribute>" +

" </q1:Attributes>" +

" </q1:ColumnSet>" +

" <q1:Distinct>false</q1:Distinct>" +

" <q1:LinkEntities>" +

" <q1:LinkEntity>" +

" <q1:LinkFromAttributeName>roleid</q1:LinkFromAttributeName>" +

" <q1:LinkFromEntityName>role</q1:LinkFromEntityName>" +

" <q1:LinkToEntityName>systemuserroles</q1:LinkToEntityName>" +

" <q1:LinkToAttributeName>roleid</q1:LinkToAttributeName>" +

" <q1:JoinOperator>Inner</q1:JoinOperator>" +

" <q1:LinkEntities>" +

" <q1:LinkEntity>" +

" <q1:LinkFromAttributeName>systemuserid</q1:LinkFromAttributeName>" +

" <q1:LinkFromEntityName>systemuserroles</q1:LinkFromEntityName>" +

" <q1:LinkToEntityName>systemuser</q1:LinkToEntityName>" +

" <q1:LinkToAttributeName>systemuserid</q1:LinkToAttributeName>" +

" <q1:JoinOperator>Inner</q1:JoinOperator>" +

" <q1:LinkCriteria>" +

" <q1:FilterOperator>And</q1:FilterOperator>" +

" <q1:Conditions>" +

" <q1:Condition>" +

" <q1:AttributeName>systemuserid</q1:AttributeName>" +

" <q1:Operator>EqualUserId</q1:Operator>" +

" </q1:Condition>" +

" </q1:Conditions>" +

" </q1:LinkCriteria>" +

" </q1:LinkEntity>" +

" </q1:LinkEntities>" +

" </q1:LinkEntity>" +

" </q1:LinkEntities>" +

" </query>" +

" </RetrieveMultiple>" +

" </soap:Body>" +

"</soap:Envelope>" +

"";

    var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");

    xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);

    xmlHttpRequest.setRequestHeader("SOAPAction", " http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple");

    xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");

    xmlHttpRequest.setRequestHeader("Content-Length", xml.length);

    xmlHttpRequest.send(xml);

    var resultXml = xmlHttpRequest.responseXML;

    return (resultXml);

}

/* Functions */





}


function priceperunit_onchange()
{
Xrm.Page.getAttribute("(removed)_extendedamt").setValue(Xrm.Page.getAttribute("priceperunit").getValue() * Xrm.Page.getAttribute("quantity").getValue());
}
function (removed)_extendedamt_onchange()
{

}
function quantity_onchange()
{
Xrm.Page.getAttribute("(removed)_extendedamt").setValue(Xrm.Page.getAttribute("priceperunit").getValue() * Xrm.Page.getAttribute("quantity").getValue());
}

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    you can replace the  "GetCurrentUserRoles" function which call CRM 4.0 web service by a supported code in  CRM 2013.

    here is a function that i developed to do the same for CRM 2013 and CRM 2015:

     function GetCurrentUserRoles() {

           var currentUserRoles = Xrm.Page.context.getUserRoles();

           var attributes = "$select=Name,RoleId";

           var criteria = [];

           var roles = [];

           for (var i in currentUserRoles) {

               criteria.push("RoleId eq guid'" + currentUserRoles[i] + "'");

           }

           var filter = "&$filter=(" + criteria.join(' or ') + ")";

           XrmServiceToolkit.Rest.RetrieveMultiple("RoleSet", attributes + filter,

                  function (result) {

                      if (result.length > 0) {

                          for (var i in result) {

                              roles.push(result[i]);

                          }

                      }

                  },

                  function (error) {

                      alert(error);

                  },

                  function OnComplet() {

                  },

                  false);

           return roles;

       }

    I use the XrmServiceToolKit library to call a CRM web service, you can download it this link xrmservicetoolkit.codeplex.com

    Hope this help!

  • Suggested answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi,

    More generally, your code is failing because it's using the 2007 endpoint in this xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);

    and that page isn't available after CRM 2011.

    If you're interested performing operations against the supported REST/OData endpoints, there's a really neat tool that builds up all the code for you so you really just need to copy and paste it. Highly recommended: crmrestbuilder.codeplex.com

    Hope this helps! If so I'd appreciate if you'd mark this as a Verified answer.

    Thanks,

     Aiden

  • Community Member Profile Picture
    on at

    yessoufy, thank so much for the speedy reply.

    I'm in the process of waiting from a reply from the accounting department to see if they have any idea what the heck this service does. Again, I'm not necessarily a programmer so I'm having trouble understanding what this even does. On a whim, in a test environment I just removed everything so now it is just function Form_onload(){}. Went to Sales - Quotes - New Quote, and nothing crashed. I ran the 2013 upgrade system checks again, and I received no error - success? Overall, what I'm wondering is, if I removed it there it doesn't seem like anything else is referencing it, otherwise wouldn't it have showed up in System Check?

  • Community Member Profile Picture
    on at

    Thanks for your reply Aiden, didn't see it until I published my reply to yessoufy. If you have a minute, please see my reply to his post - I don't think I'm interested in using that 07 endpoint.

    Before I started, the crm admin used quite a bit of custom code. I've spent years removing it, but I'm still finding bits and pieces around.

  • Suggested answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi CRM User,

    That specific method looks to see if users are in the "Quote Restriction" role, and if so, it disabled these fields 'productdescription', 'priceperunit', 'quantity', 'manualdiscountamount', '(removed)_longdescrip_exp', 'isproductoverridden'.

    Based on the method name, I assume it only runs OnLoad of the Quote form and you should be fine if you delete that event and this method, or just the content of the method (as you did).

    Hope this helps! If so I'd appreciate if you'd mark this as a Verified answer.

    Thanks,

     Aiden

  • Suggested answer
    Community Member Profile Picture
    on at

    this methode check the roles of the current user, if the user have "Quote Restrection" role so the code disabled these fields ['productdescription','priceperunit','quantity','manualdiscountamount','(removed)_longdescrip_exp','isproductoverridden'];

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