Hello,
I have a piece of code:
function rozjedTo() {
function RemoveAccents(str) {
var accents = ('ÀÁÂÃÄÅĄĀāàáâãäåąßÒÓÔÕÕÖØŐòóôőõöøĎďDŽdžÈÉÊËĘĚěèéêëęðÇçČčĆćÐÌÍÎÏĪìíîïīÙÚÛÜŰŮùűúûůüĽĹŁľĺłÑŇŃňñńŔŕŠŚŞšśşŘřŤťŸÝÿýŽŻŹžżźđĢĞģğ');
var accentsOut = ("AAAAAAAAaaaaaaaasOOOOOOOOoooooooDdDZdzEEEEEEeeeeeeeCcCcCcDIIIIIiiiiiUUUUUUuuuuůuLLLlllNNNnnnRrSSSsssRrTtYYyyZZZzzzdGGgg");
str = (str.split(''));
var strLen = str.length;
var i, x;
for (i = 0; i < strLen; i++) {
if ((x = accents.indexOf(str[i])) != -1) {
str[i] = accentsOut[x];
}
}
return str.join('');
}
let stat = getFieldValue("Stat");
let vysledekStat = stat.toUpperCase();
let trimStat = vysledekStat.trim();
let sapJmeno = getFieldValue("Jmeno");
let sapPrijmeni = getFieldValue("Prijmeni");
let sapUsername = sapPrijmeni.substring(0, 5) + sapJmeno.substring(0, 3);
let vysledek = sapUsername.toUpperCase();
let rozdilovka = ("P"+ vysledekStat + "-" + RemoveAccents(vysledek));
setFieldValue("sapUsername",rozdilovka);
}
It works great in Google Chrome and MS Edge, but not in IE11.
If I open development tools – console in GChrome – it shows no errors.
If I open IE development tools – console – it shows error depicted in the attachment.
The function is linked to a button “onclick” in “tabs” section.
Thank you in advance.
Steo
-
This topic was modified 4 years, 9 months ago by Steve.