B
ByronB
Guest
Hi Gian Thanks for that, it got us close: script function onChangeDivision(form) { var relDivision = form.contactDivision.value; if (relDivision != ""){ function cb(values) { var acctMgr = values[0][0]; //alert(acctMgrName); //alert('Before: ' + acctMgr); //$('#rbi_F_accountManager span').click(); //$('#rbi_F_accountManager').children().remove(); //rbf_setFieldValue('accountManager', null); rbf_setFieldValue('accountManager', acctMgr); rbf_selectQuery("select id, name from USER where id=" + acctMgr, 1, function cback(val){ var acctMgrId = val[0][0]; var acctMgrName = val[0][1]; alert(acctMgrName + " " + acctMgrId + "Old ID: " + {!accountManager#id}); rbf_selectObject(acctMgrId, acctMgrName, null, "accountManager", false); //rbf_selectObject(acctMgrId, acctMgrName); $('#accountManager_' + acctMgrId + ' span:nth-child(1) i:nth-child(1)').hide(); }); } rbf_selectQuery("select accountManager from division where id=" + relDivision, 1, cb); } } /script The display is good to go however on looking at the DOM the accountManager_(CurrId) is still the old Account Managers Id. As the code is above it doesnt work with the selectObject. if you change it to: rbf_selectObject({!accountManager#Id}, acctMgrName, null, "accountManager", false); It works but the accountManaget_(AcctMgrId) is the old value but not the new assigned Account Manager id
Continue reading...
Continue reading...