function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Steven Berg 5Steven Berg 5 

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 }