That means we'd have to change this bit somehow to work with an array:
Code: Select all
$('#$auf_fahrzeug option[value="'+$('#rech_fahrzeug_temp').val()+'"]').prop("selected", true);
Code: Select all
$('#$auf_fahrzeug option[value="'+$('#rech_fahrzeug_temp').val()+'"]').prop("selected", true);
Code: Select all
var e = $('#auf_fahrzeug');
var element = e[0];
var values = JSON.parse($('#rech_fahrzeug_temp').val());
for (var i = 0; i < element.options.length; i++) {
element.options[i].selected = values.indexOf(element.options[i].value) >= 0;
}
e.change();
Code: Select all
VM3933:4 Uncaught TypeError: Cannot read property 'options' of undefined
at eval (eval at nuPopulateLookup (nuform.js?ts=20210409083454:2972), <anonymous>:4:29)
at nuPopulateLookup (nuform.js?ts=20210409083454:2972)
at successCallback (nuajax.js?ts=20210409083454:589)
at Object.success (nuajax.js?ts=20210409083454:17)
at c (jquery.js?ts=20210409083454:2)
at Object.fireWith [as resolveWith] (jquery.js?ts=20210409083454:2)
at l (jquery.js?ts=20210409083454:2)
at XMLHttpRequest.<anonymous> (jquery.js?ts=20210409083454:2)
Code: Select all
$('#auf_fahrzeug').length
sorry ... too stupid to see that the right object id is "rech_fahrzeug" instead of "auf_fahrzeug".kev1n wrote:If you run this in the Developer Cnsole, it should output a 1or the object id is invalid/cannot be foundCode: Select all
$('#auf_fahrzeug').length
Code: Select all
nuSetFormValue("rech_kunde", $l->auf_kunde);
Code: Select all
Unfortunately the value on the lookup field will be set after the "No Blanks" check. ".
Code: Select all
3. Save new Record "Rechnung" and the "Kunde" will be filled from the selected "Auftrag"