mercredi 21 janvier 2015

Java Script Not Calling A function

I am creating a solution(web resource) for My CRM project. For that purpose i have written a map optimization code in java script using Bing API. i am facing a strange problem "function retrieveAccountsCallBack" is retrieving addresses from the crm. I am then using those address to find their Geo Codes. Problem is when the code reaches to point " map.getCredentials(MakeGeocodeRequest);" it is then not going into the definition Of map.getCredentials(MakeGeocodeRequest); function . It just passes this line like its commented out . But here is the twist some times it works but there is no definite pattern. PLEASE ANY ONE CAN TELL ME WHATS WRONG IN THIS .


function retrieveAccountsCallBack(retrievedAccounts) {



totalAccountCount = totalAccountCount + retrievedAccounts.length;

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

var account = retrievedAccounts[i];
//retLoc.push(account.new_address);
waypoint = retrievedAccounts[i].new_address;
map.getCredentials(MakeGeocodeRequest);
///////////////////////////////////////////

}


}


function MakeGeocodeRequest(cred) {



var geocodeRequest = "http://ift.tt/YPkbw5" + encodeURI(waypoint) + "&output=json&jsonp=GeocodeCallback&key=" + cred;
CallRestService(geocodeRequest);
}

Aucun commentaire:

Enregistrer un commentaire