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

How would I pass a trigger value to a javascript function?
I have a trigger on the contact object that checks if the phone field is updated using trigger.oldmap.get(phone)/ trigger.newmap.get(phone)
I would like to take that value say newphonenumber and pass that value as a parameter to a javascript function where I can do a ajax jquery put call. If someone has a code example i would appreciate it. Thank You
Here is some psuedo code of what I would like to do:
trigger CheckPhoneNumberChanged on Contact (before update) {
If (trigger.oldmap.get(phone) != trigger.newmap.get(phone) )
newphonevalue= trigger.newmap.get(phone);
}
// call javascript function
function passPhonevalue(newphonevalue) {
type: "PUT",
data: { "Phone":newphonevalue }
}
I would like to take that value say newphonenumber and pass that value as a parameter to a javascript function where I can do a ajax jquery put call. If someone has a code example i would appreciate it. Thank You
Here is some psuedo code of what I would like to do:
trigger CheckPhoneNumberChanged on Contact (before update) {
If (trigger.oldmap.get(phone) != trigger.newmap.get(phone) )
newphonevalue= trigger.newmap.get(phone);
}
// call javascript function
function passPhonevalue(newphonevalue) {
type: "PUT",
data: { "Phone":newphonevalue }
}