[gelöst] Adressfelder erweitern

2. September 2015 09:46

Hallo zusammen,

im neuen CRM gibt es ja sehr schöne Adressfelder. Die heißen zum Beispiel address1_composite. In denen werden auf dem Form zusammengefasst die Felder Name, Straße, Adresszusatz, PLZ, Ort und Land angezeigt. An sich finde ich das wirklich wunderbar nur mit dem Land Feld habe ich wie auch schon in der alten CRM Version mein Problem. Es ist ein reines Textfeld und bei manchen Ländern wie zum Beispiel England schreibt der eine England in das Feld und der andere Großbritannien. Das macht mir eine spätere Auswertung über Kunden einzelner Länder nahezu unmöglich. Deswegen gibt es aus unserem alten CRM die Entität Länder in der alle Länder als Datensätze angelegt sind. Diese Landentität wird bei Adresse als Feld mit angezeigt und man kann dort ein Land auswählen. Per JavaScript wird der Name dann in das Systemeigene Land Feld geschrieben. So hatte es uns der Consultant der uns damals CRM 4 noch eingerichtet hat gelöst. Nun meine Frage bekomme ich dieses Landsuchfeld in den neuen Adressblock mit rein? Auf dem Formular sehe ich an der Stelle der Adresse im Entwurf ja nur dieses Composite Feld. Oder gibt es eine andere smartere Lösung für meine Länder Problematik.
Zuletzt geändert von Nicole Schmitz am 7. September 2015 08:26, insgesamt 1-mal geändert.

Re: Adressfelder erweitern

2. September 2015 11:07

Die Frage ist ja: Wird das Composite-Field benötigt oder nicht? Wir verzichten beispielsweise darauf, eben aufgrund dieser Länderproblematik und dass das Composite-Field in 2013 sich nicht ohne Weiteres dahingehend anpassen lässt.
Vielleicht hilft dir das weiter: http://www.magnetismsolutions.com/blog/ ... y-out-menu

Re: Adressfelder erweitern

3. September 2015 09:55

Hallo Nicole,

es gibt aktuell keinen Supporten Weg, dieses Formular und seine Anzeige anzupassen.

Re: Adressfelder erweitern

3. September 2015 10:35

Hallo zusammen,

kein Supporteter Weg ist aber mehr als schade :-( .

Wobei ich einen Weg gefunden habe bei dem mir nicht ganz klar ist was daran dann unsupported ist. Wäre schön wenn ihr mich da aufklären könntet worin die Gefahr in dieser Lösung besteht sie funktioniert nämlich ganz wunderbar.
Gefunden habe ich die Lösung hier https://msdynamicscrmblog.wordpress.com/2013/05/28/make-country-and-state-fields-into-dropdown-list-in-dynamics-crm-2011/. Diese Lösung war eigentlich für CRM 2011 gedacht, nach ein paar Anpassungen funktioniert sie aber auch ganz wunderbar unter 2015.
Hier der angepasste Code. Die ganzen Länder die wir vorher in unserer Entität Länder hatten habe ich auch gleich übernommen. Ob man wirklich alle braucht sei jetzt mal dahingestellt. :-D :
Code:
// Configures the country field to be a dropdown based on the Country object.
function LoadCountryField(countryFieldName, stateFieldName, compositename) { debugger
    var $countryField = $('#' + compositename + '_' + countryFieldName);
   var countryFieldFullName = compositename + '_' + countryFieldName;
    if ($countryField.length < 1) return;
    $countryField.hide();
    //var selectedCountry = $countryField.val();
   var selectedCountry;
   if (Xrm.Page.ui.getFormType() == 1) {
      selectedCountry = "Deutschland";
   } else {
      //selectedCountry = $countryField.val();
      selectedCountry = Xrm.Page.getAttribute(countryFieldName).getValue();
   }
    var countryRequirementLevel = Xrm.Page.getAttribute(countryFieldName).getRequiredLevel();
    countryRequirementLevel = countryRequirementLevel == "required" ? 2 : countryRequirementLevel == "recommended" ? 1 : 0;
    var $countryDropdown = generateSelectBox('ddl_' + countryFieldName, countryRequirementLevel, Countries, selectedCountry);
    $('#' + compositename + '_' + countryFieldName + '_d').append($countryDropdown);
    $countryDropdown.change({ 'countryFieldName': countryFieldName, 'stateFieldName': stateFieldName, 'compositename': compositename }, handleCountryChanged);
    document.getElementById('ddl_' + countryFieldName).tabIndex = document.getElementById(countryFieldFullName).tabIndex;
    LoadStateField(stateFieldName, selectedCountry, compositename);
}
// Configures the stateOrProvince field to be a dropdown dependent on the value of the country dropdown. Values are pulled from the Countries object.
function LoadStateField(stateFieldName, selectedCountry, compositename) {
   var stateFieldFullName = compositename + '_' + stateFieldName;
    var stateAttr = Xrm.Page.getAttribute(stateFieldName);
    var selectedState = stateAttr == null ? "" : stateAttr.getValue();
    var states = getStatesForCountry(selectedCountry);
    var $stateField = $('#' + compositename + '_' + stateFieldName);
    if (states == null || !$.isArray(states) || states.length < 1) {
        $('#ddl_' + stateFieldName).remove();
      Xrm.Page.getAttribute(stateFieldName).setValue("");
        $stateField.show();
        return;
    }
    $stateField.hide();
    var stateRequirementLevel = Xrm.Page.getAttribute(stateFieldName).getRequiredLevel();
    stateRequirementLevel = stateRequirementLevel == "required" ? 2 : stateRequirementLevel == "recommended" ? 1 : 0;
    var $stateDropdown = generateSelectBox('ddl_' + stateFieldName, stateRequirementLevel, states, selectedState);
    var $existingDropdown = $('#ddl_' + stateFieldName);
    if ($existingDropdown.length < 1)
        $('#' + compositename + '_' + stateFieldName + '_d').append($stateDropdown);
    else
        $existingDropdown.replaceWith($stateDropdown);
    $stateDropdown.change({ 'stateFieldName': stateFieldName }, handleStateChanged);
    $stateDropdown.change();
    document.getElementById('ddl_' + stateFieldName).tabIndex = document.getElementById(stateFieldFullName).tabIndex;
}
// Finds the states that go with selectedCountry, using the Countries object.
function getStatesForCountry(selectedCountry) {
    for (i in Countries) {
        var country = Countries[i];
        if (selectedCountry == country.name)
            return country.states;
    }
    return [];
}
// Sets the value of the country field to the newly selected value and reconfigures the dependent state dropdown.
function handleCountryChanged(eventData) {
    var stateFieldName = eventData.data.stateFieldName;
   var compositename = eventData.data.compositename;
    var selectedCountry = setFieldFromDropdown(eventData.data.countryFieldName);
    LoadStateField(stateFieldName, selectedCountry, compositename);
}
// Sets the value of the stateOrProvince field to the newly selected value
function handleStateChanged(eventData) {
    setFieldFromDropdown(eventData.data.stateFieldName);
}
// Sets a field's value based on a related dropdown's value
function setFieldFromDropdown(fieldName) {
    var $dropdown = $('#ddl_' + fieldName);
    if ($dropdown.length != 1) return null;
    var selectedValue = $dropdown.find('option:selected:first').val();
    var attr = Xrm.Page.getAttribute(fieldName);
    if (attr != null) attr.setValue(selectedValue);
    return selectedValue;
}
// Generates a new select box with appropriate attributes for MS CRM 2011.
function generateSelectBox(id, requirementLevel, options, selectedValue) {
    var $ddl = $('<select id="' + id + '" class="ms-crm-SelectBox" req="' + requirementLevel + '" height="4" style="IME-MODE: auto; width: 100%"></select>');
    $ddl.append(jQuery('<option></option').val('').html(''));
    $.each(options, function (i, item) {
        $ddl.append(jQuery('<option></option').val(item.name).html(item.name));
        if (selectedValue == item.name)
            $ddl.find('option:last').attr('selected', 'selected');
    });
    return $ddl;
}
// Global array of countries and their respective states
var Countries = [
                   
{ "name": "Afghanistan", "abbr": "AF", "states": [] },
{ "name": "Ägypten", "abbr": "EG", "states": [] },
{ "name": "Argentinien", "abbr": "AR", "states": [] },
{ "name": "Åland", "abbr": "AX", "states": [] },
{ "name": "Albanien", "abbr": "AL", "states": [] },
{ "name": "Algerien", "abbr": "DZ", "states": [] },
{ "name": "Amerikanische Jungferninseln", "abbr": "VI", "states": [] },
{ "name": "Amerikanisch-Samoa", "abbr": "AS", "states": [] },
{ "name": "Andorra", "abbr": "AD", "states": [] },
{ "name": "Angola", "abbr": "AO", "states": [] },
{ "name": "Anguilla", "abbr": "AI", "states": [] },
{ "name": "Antarktis (Sonderstatus durch Antarktis-Vertrag)", "abbr": "AQ", "states": [] },
{ "name": "Antigua und Barbuda", "abbr": "AG", "states": [] },
{ "name": "Äquatorialguinea", "abbr": "GQ", "states": [] },
{ "name": "Argentinien", "abbr": "AR", "states": [] },
{ "name": "Armenien", "abbr": "AM", "states": [] },
{ "name": "Aruba", "abbr": "AW", "states": [] },
{ "name": "Ascension (verwaltet von St. Helena, reserviert für UPU und ITU)", "abbr": "AC1", "states": [] },
{ "name": "Aserbaidschan", "abbr": "AZ", "states": [] },
{ "name": "Äthiopien", "abbr": "ET", "states": [] },
{ "name": "Australien", "abbr": "AU", "states": [] },
{ "name": "Bahama", "abbr": "BS", "states": [] },
{ "name": "Bahrain", "abbr": "BH", "states": [] },
{ "name": "Bangladesch", "abbr": "BD", "states": [] },
{ "name": "Barbados", "abbr": "BB", "states": [] },
{ "name": "Belarus (Weißrussland)", "abbr": "BY", "states": [] },
{ "name": "Belgien", "abbr": "BE", "states": [] },
{ "name": "Belize", "abbr": "BZ", "states": [] },
{ "name": "Benin", "abbr": "BJ", "states": [] },
{ "name": "Bermuda", "abbr": "BM", "states": [] },
{ "name": "Bhutan", "abbr": "BT", "states": [] },
{ "name": "Bolivien", "abbr": "BO", "states": [] },
{ "name": "Bosnien und Herzegowina", "abbr": "BA", "states": [] },
{ "name": "Botswana", "abbr": "BW", "states": [] },
{ "name": "Bouvetinsel", "abbr": "BV", "states": [] },
{ "name": "Brasilien", "abbr": "BR", "states": [] },
{ "name": "Britische Jungferninseln", "abbr": "VG", "states": [] },
{ "name": "Britisches Territorium im Indischen Ozean", "abbr": "IO", "states": [] },
{ "name": "Brunei Darussalam", "abbr": "BN", "states": [] },
{ "name": "Bulgarien", "abbr": "BG", "states": [] },
{ "name": "Burkina Faso", "abbr": "BF", "states": [] },
{ "name": "Burma (jetzt Myanmar)", "abbr": "BU", "states": [] },
{ "name": "Burundi", "abbr": "BI", "states": [] },
{ "name": "Ceuta, Melilla", "abbr": "EA", "states": [] },
{ "name": "Chile", "abbr": "CL", "states": [] },
{ "name": "China, Volksrepublik", "abbr": "CN", "states": [] },
{ "name": "Clipperton (reserviert für ITU)", "abbr": "CP", "states": [] },
{ "name": "Cookinseln", "abbr": "CK", "states": [] },
{ "name": "Costa Rica", "abbr": "CR", "states": [] },
{ "name": "Côte d'Ivoire (Elfenbeinküste)", "abbr": "CI", "states": [] },
{ "name": "Dänemark", "abbr": "DK", "states": [] },
{ "name": "Deutschland", "abbr": "DE", "states": [
      { "name": "Baden-Württemberg", "abbr": "BW" },
      { "name": "Bayern", "abbr": "BY" },
      { "name": "Berlin", "abbr": "BE" },
      { "name": "Brandenburg", "abbr": "BB" },
      { "name": "Bremen", "abbr": "HB" },
      { "name": "Hamburg", "abbr": "HH" },
      { "name": "Hessen", "abbr": "HE" },
      { "name": "Mecklenburg-Vorpommern", "abbr": "MV" },
      { "name": "Niedersachsen", "abbr": "NI" },
      { "name": "Nordrhein-Westfalen", "abbr": "NW" },
      { "name": "Rheinland-Pfalz", "abbr": "RP" },
      { "name": "Saarland", "abbr": "SL" },
      { "name": "Sachsen", "abbr": "SN" },
      { "name": "Sachsen-Anhalt", "abbr": "ST" },
      { "name": "Schleswig-Holstein", "abbr": "SH" },
      { "name": "Thüringen", "abbr": "TH" }]
},
{ "name": "Diego Garcia (reserviert für ITU)", "abbr": "DG", "states": [] },
{ "name": "Dominica", "abbr": "DM", "states": [] },
{ "name": "Dominikanische Republik", "abbr": "DO", "states": [] },
{ "name": "Dschibuti", "abbr": "DJ", "states": [] },
{ "name": "Ecuador", "abbr": "EC", "states": [] },
{ "name": "El Salvador", "abbr": "SV", "states": [] },
{ "name": "England", "abbr": "", "states": [] },
{ "name": "Eritrea", "abbr": "ER", "states": [] },
{ "name": "Estland", "abbr": "EE", "states": [] },
{ "name": "Europäische Gemeinschaft", "abbr": "CE", "states": [] },
{ "name": "Europäische Union", "abbr": "EU", "states": [] },
{ "name": "Falklandinseln", "abbr": "FK", "states": [] },
{ "name": "FaroerFäröer", "abbr": "FO", "states": [] },
{ "name": "Fidschi", "abbr": "FJ", "states": [] },
{ "name": "Finnland", "abbr": "FI", "states": [] },
{ "name": "Frankreich", "abbr": "FR", "states": [] },
{ "name": "Frankreich, France métropolitaine (europ. Frankreich ohne Übersee-Départements)", "abbr": "FX", "states": [] },
{ "name": "Französische Süd- und Antarktisgebiete", "abbr": "TF", "states": [] },
{ "name": "Französisch-Guayana", "abbr": "GF", "states": [] },
{ "name": "Französisch-Polynesien", "abbr": "PF", "states": [] },
{ "name": "Gabun", "abbr": "GA", "states": [] },
{ "name": "Gambia", "abbr": "GM", "states": [] },
{ "name": "Georgien", "abbr": "GE", "states": [] },
{ "name": "Ghana", "abbr": "GH", "states": [] },
{ "name": "Gibraltar", "abbr": "GI", "states": [] },
{ "name": "Grenada", "abbr": "GD", "states": [] },
{ "name": "Griechenland", "abbr": "GR", "states": [] },
{ "name": "Grönland", "abbr": "GL", "states": [] },
{ "name": "Guadeloupe", "abbr": "GP", "states": [] },
{ "name": "Guam", "abbr": "GU", "states": [] },
{ "name": "Guatemala", "abbr": "GT", "states": [] },
{ "name": "Guernsey (Kanalinsel)", "abbr": "GG", "states": [] },
{ "name": "Guinea", "abbr": "GN", "states": [] },
{ "name": "Guinea-Bissau", "abbr": "GW", "states": [] },
{ "name": "Guyana", "abbr": "GY", "states": [] },
{ "name": "Haiti", "abbr": "HT", "states": [] },
{ "name": "Heard- und McDonald-Inseln", "abbr": "HM", "states": [] },
{ "name": "Honduras", "abbr": "HN", "states": [] },
{ "name": "Hongkong", "abbr": "HK", "states": [] },
{ "name": "Indien", "abbr": "IN", "states": [] },
{ "name": "Indonesien", "abbr": "ID", "states": [] },
{ "name": "Insel Man", "abbr": "IM", "states": [] },
{ "name": "Irak", "abbr": "IQ", "states": [] },
{ "name": "Iran, Islamische Republik", "abbr": "IR", "states": [] },
{ "name": "Irland", "abbr": "IE", "states": [] },
{ "name": "Island", "abbr": "IS", "states": [] },
{ "name": "Italien", "abbr": "IT", "states": [] },
{ "name": "Israel", "abbr": "IL", "states": [] },
{ "name": "Jamaika", "abbr": "JM", "states": [] },
{ "name": "Japan", "abbr": "JP", "states": [] },
{ "name": "Jemen", "abbr": "YE", "states": [] },
{ "name": "Jersey (Kanalinsel)", "abbr": "JE", "states": [] },
{ "name": "Jordanien", "abbr": "JO", "states": [] },
{ "name": "Jugoslawien (ehemalig)", "abbr": "YU", "states": [] },
{ "name": "Kaimaninseln", "abbr": "KY", "states": [] },
{ "name": "Kambodscha", "abbr": "KH", "states": [] },
{ "name": "Kamerun", "abbr": "CM", "states": [] },
{ "name": "Kanada", "abbr": "CA", "states": [{ "name": "Alberta", "abbr": "AB" },
        { "name": "British Columbia", "abbr": "BC" },
        { "name": "Manitoba", "abbr": "MB" },
        { "name": "New Brunswick", "abbr": "NB" },
        { "name": "Newfoundland and Labrador", "abbr": "NL" },
        { "name": "Northwest Territories", "abbr": "NT" },
        { "name": "Nova Scotia", "abbr": "NS" },
        { "name": "Nunavut", "abbr": "NU" },
        { "name": "Ontario", "abbr": "ON" },
        { "name": "Prince Edward Island", "abbr": "PE" },
        { "name": "Quebec", "abbr": "QC" },
        { "name": "Saskatchewan", "abbr": "SK" },
        { "name": "Yukon", "abbr": "YT"}]
},
{ "name": "Kanarische Inseln", "abbr": "IC1", "states": [] },
{ "name": "Kap Verde", "abbr": "CV", "states": [] },
{ "name": "Kasachstan", "abbr": "KZ", "states": [] },
{ "name": "Katar", "abbr": "QA", "states": [] },
{ "name": "Kenia", "abbr": "KE", "states": [] },
{ "name": "Kirgisistan", "abbr": "KG", "states": [] },
{ "name": "Kiribati", "abbr": "KI", "states": [] },
{ "name": "Kokosinseln", "abbr": "CC", "states": [] },
{ "name": "Kolumbien", "abbr": "CO", "states": [] },
{ "name": "Komoren", "abbr": "KM", "states": [] },
{ "name": "Kongo, Demokratische Republik (ehem. Zaire)", "abbr": "CD", "states": [] },
{ "name": "Korea, Demokratische Volksrepublik (Nordkorea)", "abbr": "KP", "states": [] },
{ "name": "Korea, Republik (Südkorea)", "abbr": "KR", "states": [] },
{ "name": "Kosovo", "abbr": "", "states": [] },
{ "name": "Kroatien", "abbr": "HR", "states": [] },
{ "name": "Kuba", "abbr": "CU", "states": [] },
{ "name": "Kuwait", "abbr": "KW", "states": [] },
{ "name": "Laos, Demokratische Volksrepublik", "abbr": "LA", "states": [] },
{ "name": "Lesotho", "abbr": "LS", "states": [] },
{ "name": "Lettland", "abbr": "LV", "states": [] },
{ "name": "Libanon", "abbr": "LB", "states": [] },
{ "name": "Liberia", "abbr": "LR", "states": [] },
{ "name": "Libysch-Arabische Dschamahirija (Libyen)", "abbr": "LY", "states": [] },
{ "name": "Liechtenstein", "abbr": "LI", "states": [] },
{ "name": "Litauen", "abbr": "LT", "states": [] },
{ "name": "Luxemburg", "abbr": "LU", "states": [] },
{ "name": "Macao", "abbr": "MO", "states": [] },
{ "name": "Madagaskar", "abbr": "MG", "states": [] },
{ "name": "Malawi", "abbr": "MW", "states": [] },
{ "name": "Malaysia", "abbr": "MY", "states": [] },
{ "name": "Malediven", "abbr": "MV", "states": [] },
{ "name": "Mali", "abbr": "ML", "states": [] },
{ "name": "Malta", "abbr": "MT", "states": [] },
{ "name": "Marokko", "abbr": "MA", "states": [] },
{ "name": "Marshallinseln", "abbr": "MH", "states": [] },
{ "name": "Martinique", "abbr": "MQ", "states": [] },
{ "name": "Mauretanien", "abbr": "MR", "states": [] },
{ "name": "Mauritius", "abbr": "MU", "states": [] },
{ "name": "Mayotte", "abbr": "YT", "states": [] },
{ "name": "Mazedonien, ehem. jugoslawische Republik [2b]", "abbr": "MK", "states": [] },
{ "name": "Mexico", "abbr": "MX", "states": [
      { "name": "Aguascalientes", "abbr": "AGS" },
      { "name": "Baja California Norte", "abbr": "BCN" },
      { "name": "Baja California Sur", "abbr": "BCS" },
      { "name": "Campeche", "abbr": "CAM" },
      { "name": "Chiapas", "abbr": "CHIS" },
      { "name": "Chihuahua", "abbr": "CHIH" },
      { "name": "Coahuila", "abbr": "COAH" },
      { "name": "Colima", "abbr": "COL" },
      { "name": "Distrito Federal", "abbr": "DF" },
      { "name": "Durango", "abbr": "DGO" },
      { "name": "Guanajuato", "abbr": "GTO" },
      { "name": "Guerrero", "abbr": "GRO" },
      { "name": "Hidalgo", "abbr": "HGO" },
      { "name": "Jalisco", "abbr": "JAL" },
      { "name": "México - Estado de", "abbr": "EDM" },
      { "name": "Michoacán", "abbr": "MICH" },
      { "name": "Morelos", "abbr": "MOR" },
      { "name": "Nayarit", "abbr": "NAY" },
      { "name": "Nuevo León", "abbr": "NL" },
      { "name": "Oaxaca", "abbr": "OAX" },
      { "name": "Puebla", "abbr": "PUE" },
      { "name": "Querétaro", "abbr": "QRO" },
      { "name": "Quintana Roo", "abbr": "QROO" },
      { "name": "San Luis Potosí", "abbr": "SLP" },
      { "name": "Sinaloa", "abbr": "SIN" },
      { "name": "Sonora", "abbr": "SON" },
      { "name": "Tabasco", "abbr": "TAB" },
      { "name": "Tamaulipas", "abbr": "TAMPS" },
      { "name": "Tlaxcala", "abbr": "TLAX" },
      { "name": "Veracruz", "abbr": "VER" },
      { "name": "Yucatán", "abbr": "YUC" },
      { "name": "Zacatecas", "abbr": "ZAC"}]
},
{ "name": "Mikronesien", "abbr": "FM", "states": [] },
{ "name": "Moldawien (Republik Moldau)", "abbr": "MD", "states": [] },
{ "name": "Monaco", "abbr": "MC", "states": [] },
{ "name": "Mongolei", "abbr": "MN", "states": [] },
{ "name": "Montenegro", "abbr": "ME", "states": [] },
{ "name": "Montserrat", "abbr": "MS", "states": [] },
{ "name": "Mosambik", "abbr": "MZ", "states": [] },
{ "name": "Myanmar (Burma)", "abbr": "MM", "states": [] },
{ "name": "Namibia", "abbr": "NA", "states": [] },
{ "name": "Nauru", "abbr": "NR", "states": [] },
{ "name": "Nepal", "abbr": "NP", "states": [] },
{ "name": "Neukaledonien", "abbr": "NC", "states": [] },
{ "name": "Neuseeland", "abbr": "NZ", "states": [] },
{ "name": "Neutrale Zone (Saudi-Arabien und Irak)", "abbr": "NT", "states": [] },
{ "name": "Nicaragua", "abbr": "NI", "states": [] },
{ "name": "Niederlande", "abbr": "NL", "states": [] },
{ "name": "Niederländische Antillen", "abbr": "AN", "states": [] },
{ "name": "Niger", "abbr": "NE", "states": [] },
{ "name": "Nigeria", "abbr": "NG", "states": [] },
{ "name": "Niue", "abbr": "NU", "states": [] },
{ "name": "Nordliche MarianenNördliche Marianen", "abbr": "MP", "states": [] },
{ "name": "Norfolkinsel", "abbr": "NF", "states": [] },
{ "name": "Norwegen", "abbr": "NO", "states": [] },
{ "name": "Oman", "abbr": "OM", "states": [] },
{ "name": "Österreich", "abbr": "AT", "states": [] },
{ "name": "Osttimor (Timor-L'este)", "abbr": "TL", "states": [] },
{ "name": "Pakistan", "abbr": "PK", "states": [] },
{ "name": "Palästinensische Autonomiegebiete", "abbr": "PS", "states": [] },
{ "name": "Palau", "abbr": "PW", "states": [] },
{ "name": "Panama", "abbr": "PA", "states": [] },
{ "name": "Papua-Neuguinea", "abbr": "PG", "states": [] },
{ "name": "Paraguay", "abbr": "PY", "states": [] },
{ "name": "Peru", "abbr": "PE", "states": [] },
{ "name": "Philippinen", "abbr": "PH", "states": [] },
{ "name": "Pitcairninseln", "abbr": "PN", "states": [] },
{ "name": "Polen", "abbr": "PL", "states": [] },
{ "name": "Portugal", "abbr": "PT", "states": [] },
{ "name": "Puerto Rico", "abbr": "PR", "states": [] },
{ "name": "Republik China (Taiwan)", "abbr": "TW", "states": [] },
{ "name": "Republik Kongo", "abbr": "CG", "states": [] },
{ "name": "Réunion", "abbr": "RE", "states": [] },
{ "name": "Ruanda", "abbr": "RW", "states": [] },
{ "name": "Rumänien", "abbr": "RO", "states": [] },
{ "name": "Russische Föderation", "abbr": "RU", "states": [] },
{ "name": "Saint-Barthélemy", "abbr": "BL", "states": [] },
{ "name": "Saint-Martin (franz. Teil)", "abbr": "MF", "states": [] },
{ "name": "Saint-Pierre und Miquelon", "abbr": "PM", "states": [] },
{ "name": "Salomonen", "abbr": "SB", "states": [] },
{ "name": "Sambia", "abbr": "ZM", "states": [] },
{ "name": "Samoa", "abbr": "WS", "states": [] },
{ "name": "San Marino", "abbr": "SM", "states": [] },
{ "name": "Sao Tome und PríncipeSão Tomé und Príncipe", "abbr": "ST", "states": [] },
{ "name": "Saudi-Arabien", "abbr": "SA", "states": [] },
{ "name": "Schweden", "abbr": "SE", "states": [] },
{ "name": "Schweiz (Confoederatio Helvetica)", "abbr": "CH", "states": [] },
{ "name": "Senegal", "abbr": "SN", "states": [] },
{ "name": "Serbien", "abbr": "RS", "states": [] },
{ "name": "Serbien und Montenegro (ehemalig)", "abbr": "CS", "states": [] },
{ "name": "Seychellen", "abbr": "SC", "states": [] },
{ "name": "Sierra Leone", "abbr": "SL", "states": [] },
{ "name": "Simbabwe", "abbr": "ZW", "states": [] },
{ "name": "Singapur", "abbr": "SG", "states": [] },
{ "name": "Slowakei", "abbr": "SK", "states": [] },
{ "name": "Slowenien", "abbr": "SI", "states": [] },
{ "name": "Somalia", "abbr": "SO", "states": [] },
{ "name": "Spanien", "abbr": "ES", "states": [] },
{ "name": "Sri Lanka", "abbr": "LK", "states": [] },
{ "name": "St. Helena", "abbr": "SH", "states": [] },
{ "name": "St. Kitts und Nevis", "abbr": "KN", "states": [] },
{ "name": "St. Lucia", "abbr": "LC", "states": [] },
{ "name": "St. Vincent und die Grenadinen", "abbr": "VC", "states": [] },
{ "name": "Südafrika", "abbr": "ZA", "states": [] },
{ "name": "Sudan", "abbr": "SD", "states": [] },
{ "name": "Südgeorgien und die Südlichen Sandwichinseln", "abbr": "GS", "states": [] },
{ "name": "Suriname", "abbr": "SR", "states": [] },
{ "name": "Svalbard und Jan Mayen", "abbr": "SJ", "states": [] },
{ "name": "Swasiland", "abbr": "SZ", "states": [] },
{ "name": "Syrien, Arabische Republik", "abbr": "SY", "states": [] },
{ "name": "Tadschikistan", "abbr": "TJ", "states": [] },
{ "name": "Tansania, Vereinigte Republik", "abbr": "TZ", "states": [] },
{ "name": "Thailand", "abbr": "TH", "states": [] },
{ "name": "Togo", "abbr": "TG", "states": [] },
{ "name": "Tokelau", "abbr": "TK", "states": [] },
{ "name": "Tonga", "abbr": "TO", "states": [] },
{ "name": "Trinidad und Tobago", "abbr": "TT", "states": [] },
{ "name": "Tristan da Cunha (verwaltet von St. Helena, reserviert für UPU)", "abbr": "TA1", "states": [] },
{ "name": "Tschad", "abbr": "TD", "states": [] },
{ "name": "Tschechische Republik", "abbr": "CZ", "states": [] },
{ "name": "Tschechoslowakei (ehemalig)", "abbr": "CS", "states": [] },
{ "name": "Tunesien", "abbr": "TN", "states": [] },
{ "name": "Türkei", "abbr": "TR", "states": [] },
{ "name": "Turkmenistan", "abbr": "TM", "states": [] },
{ "name": "Turks- und Caicosinseln", "abbr": "TC", "states": [] },
{ "name": "Tuvalu", "abbr": "TV", "states": [] },
{ "name": "UdSSR (jetzt: Russische Föderation)", "abbr": "SU", "states": [] },
{ "name": "Uganda", "abbr": "UG", "states": [] },
{ "name": "Ukraine", "abbr": "UA", "states": [] },
{ "name": "Ungarn", "abbr": "HU", "states": [] },
{ "name": "United States Minor Outlying Islands", "abbr": "UM", "states": [] },
{ "name": "Uruguay", "abbr": "UY", "states": [] },
{ "name": "Usbekistan", "abbr": "UZ", "states": [] },
{ "name": "Vanuatu", "abbr": "VU", "states": [] },
{ "name": "Vatikanstadt", "abbr": "VA", "states": [] },
{ "name": "Venezuela", "abbr": "VE", "states": [] },
{ "name": "Vereinigte Arabische Emirate", "abbr": "AE", "states": [] },
{ "name": "Vereinigte Staaten von Amerkia", "abbr": "US", "states": [{ "name": "Alabama", "abbr": "AL" },
      { "name": "Alaska", "abbr": "AK" },
      { "name": "Arizona", "abbr": "AZ" },
      { "name": "Arkansas", "abbr": "AR" },
      { "name": "California", "abbr": "CA" },
      { "name": "Colorado", "abbr": "CO" },
      { "name": "Connecticut", "abbr": "CT" },
      { "name": "Delaware", "abbr": "DE" },
      { "name": "District Of Columbia", "abbr": "DC" },
      { "name": "Florida", "abbr": "FL" },
      { "name": "Georgia", "abbr": "GA" },
      { "name": "Hawaii", "abbr": "HI" },
      { "name": "Idaho", "abbr": "ID" },
      { "name": "Illinois", "abbr": "IL" },
      { "name": "Indiana", "abbr": "IN" },
      { "name": "Iowa", "abbr": "IA" },
      { "name": "Kansas", "abbr": "KS" },
      { "name": "Kentucky", "abbr": "KY" },
      { "name": "Louisiana", "abbr": "LA" },
      { "name": "Maine", "abbr": "ME" },
      { "name": "Maryland", "abbr": "MD" },
      { "name": "Massachusetts", "abbr": "MA" },
      { "name": "Michigan", "abbr": "MI" },
      { "name": "Minnesota", "abbr": "MN" },
      { "name": "Mississippi", "abbr": "MS" },
      { "name": "Missouri", "abbr": "MO" },
      { "name": "Montana", "abbr": "MT" },
      { "name": "Nebraska", "abbr": "NE" },
      { "name": "Nevada", "abbr": "NV" },
      { "name": "New Hampshire", "abbr": "NH" },
      { "name": "New Jersey", "abbr": "NJ" },
      { "name": "New Mexico", "abbr": "NM" },
      { "name": "New York", "abbr": "NY" },
      { "name": "North Carolina", "abbr": "NC" },
      { "name": "North Dakota", "abbr": "ND" },
      { "name": "Ohio", "abbr": "OH" },
      { "name": "Oklahoma", "abbr": "OK" },
      { "name": "Oregon", "abbr": "OR" },
      { "name": "Pennsylvania", "abbr": "PA" },
      { "name": "Puerto Rico", "abbr": "PR" },
      { "name": "Rhode Island", "abbr": "RI" },
      { "name": "South Carolina", "abbr": "SC" },
      { "name": "South Dakota", "abbr": "SD" },
      { "name": "Tennessee", "abbr": "TN" },
      { "name": "Texas", "abbr": "TX" },
      { "name": "Utah", "abbr": "UT" },
      { "name": "Vermont", "abbr": "VT" },
      { "name": "Virgin Islands", "abbr": "VI" },
      { "name": "Virginia", "abbr": "VA" },
      { "name": "Washington", "abbr": "WA" },
      { "name": "West Virginia", "abbr": "WV" },
      { "name": "Wisconsin", "abbr": "WI" },
      { "name": "Wyoming", "abbr": "WY"}]
                    },
{ "name": "Vereinigtes Königreich Großbritannien und Nordirland", "abbr": "GB", "states": [] },
{ "name": "Vietnam", "abbr": "VN", "states": [] },
{ "name": "Wallis und Futuna", "abbr": "WF", "states": [] },
{ "name": "Weihnachtsinsel", "abbr": "CX", "states": [] },
{ "name": "Westsahara", "abbr": "EH", "states": [] },
{ "name": "Zaire (jetzt Demokratische Republik Kongo)", "abbr": "ZR", "states": [] },
{ "name": "Zentralafrikanische Republik", "abbr": "CF", "states": [] },
{ "name": "Zypern", "abbr": "CY", "states": [] },
{ "name": "Other International", "abbr": "OINT", "states": [] }
];

Re: Adressfelder erweitern

3. September 2015 10:39

Das JQuery und document.getElementById verwendet wird ist das Problem oder? Gibt es dafür keine Alternativen?

Re: Adressfelder erweitern

4. September 2015 09:29

Hallo Nicole,

jquere ist kein Problem, aber Dokument.getElementById.
Das isst ein direkter Zugriff auf das DOM und damit unsupportet.

Das Schrot wird auch wahrscheinlich nicht in allen Browsern funktionieren sondern nur im IE

Re: Adressfelder erweitern

7. September 2015 08:26

Hallo Michael,

ok vielen Dank für die Rückinfo. Dann lasse ich die nicht so schöne Alternative mit Ländersuchfeld außerhalb des Adressblocks bestehen. Für den Updatefall der dazu führt, dass die JavaScript Pull-Down Variante nicht mehr funktioniert. Kaputt machen kann dieses Ausblenden des Feldes ja nichts und solange es funktioniert ist ja gut. Wenn es beim nächsten Update nicht mehr geht schalte ich halt wieder um. Es Funktioniert im übrigen nicht nur im IE sondern auch im Chrome und im Firefox. Mehr Browser habe ich allerdings noch nicht ausprobiert, da wir nicht mehr einsetzen.

Schade das CRM keinen direkten Zugriff aufs DOM supportet und auch keine gute Alternative bietet. Vielleicht kommt sowas ja mit einem der nächsten Updates. Hoffen darf man ja :)