You need to sign in to do that
Don't have an account?

Alert Pulling the value from a field
Hi All,
When a button is clicked if there are any conversion issues the following alert code runs:
alert('Conversion Issues');
}
Instead of displaying the text 'Conversion Issue' I would like it to pull the value from the !Lead.Conversion_Issues__c field.
TIA
--David
alert('{!yourLeadControllerVariable.Conversion_Issues__c}');
How would I set up the variable in Apex?
--David
Are you using the Lead object as the standard controller, or are you using a custom one?
The lead object.
So it's the record in your controller that you're working with.
For example, if this is in your controller:
Then the variable would be l.
Craig,
That's for the help. But I'm still a bit unclear. Below is the code on our button:
if('{!Lead.Conversion_Ready__c}' == true){
window.location.href = '/apex/ConvertLead?id={!Lead.Id}';
}
else {
alert('Conversion Issues');
}
Can I assign that varible within this code or do I need to create a separate class?
--David