Quantcast
Channel: Forum CRM Development
Viewing all articles
Browse latest Browse all 1000

SQK.JQuery.retrieveMultipleRecords firing multiple times

$
0
0

Given the function below which is called once on a contact entity field event handler, the retrieveMultipleRecords is firing about 6-8 times. The onchange event handler for a Contact field is firing once (confirmed).

function tssLoadSecurityRoleId(rolename) {
    alert("load Security Role");
    var select = "$select=RoleId" + "&$filter=Name eq '" + rolename + "' ";
    alert("select: " + select);

    SDK.JQuery.retrieveMultipleRecords(
        tssFormatProperCase("role"),
        select,
        function (results) {
            alert("role: retrieve multiple records:results.length:" + results.length);
            if (results.length > 0) {
                alert("results.length > 0");
                var obj = results[0];
                alert("roleid:" + obj["RoleId"]);
                tss_v_UIMerge_Security_Role_Guid = obj["RoleId"];
                alert(tss_v_UIMerge_Security_Role_Guid);
                tssCheckUserRole();
            }
            else {
                alert("Role not found in system:" + rolename);
                return;
            }
        },
        tssErrorHandler,
        tssOnComplete
    );
}

note that the alert for "load Security Role" displays once. However, the alert for

"role: retrieve multiple records:results.length:"

displays 6-8 times. The only thing I can spot is that its the first call to the JQuery SDK REST library from the code. Note: there are other solutions from other vendors at the client site...and there is another JQuery library loaded as a web resource. Could it be that the AJAX call binds itself to all the jquery libraries loaded? this is only at a single client install...internally on multiple configurations, this has not been a problem.

Note: I have found 5 JQuery libraries loaded...wow...I guess each vendor has loaded it separately...



Viewing all articles
Browse latest Browse all 1000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>