Have a visualforce page with that is generated from a custom button on the account. On this page, we have some JS that contains an array. I am trying to take the value of the below field from the account:
<apex:outputField value="{!account.lastname}" id="lastname" />
And on a button click, find this value as a key and return the value from the array.
function myfunction(){
window.alert(array["{!account.lastname}"])}
I am receiving "undefined" in the alert. If I just alert the outputfield it will display it, but not access it from the array. Thanks.
var minitialList = { ip: 61, b: 62, c: 63, d: 64, e: 65, f: 66, g: 67, h: 68, i: 69, j: 70, k: 71, l: 72, m: 73, n: 74, o: 75, p: 76, q: 77, r: 78, s: 82, t: 83, u: 84, v: 85, w: 86, x: 87, y: 88, z: 89, NONE: 00 }
– George Albrecht Jan 29 at 13:50window.alert(minitialList["{!account.lastname}"]
and it will only return something if the account lastname is "ip" or "b" or something. Your array keys are letters. What are you trying to do? – Dominic Jan 29 at 14:27window.alert(array["{!account.lastname}"])
note it saysarray
notminitialList
– Dominic Jan 29 at 14:45