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
SFDC developer999SFDC developer999 

what is purpose of {!REQUIRESCRIPT("/soap/ajax/32.0/connection.js")}

I have a button using onclick javascript with this code:
{!REQUIRESCRIPT("/soap/ajax/32.0/connection.js")}
   result = sforce.connection.update([object]);
the button is supposed to send an email. However , the email was not sent, Where to check the issue?
Thanks
karthikeyan perumalkarthikeyan perumal
Hello, 

This is is used to establish the connection with salesfroce using javascript. 
 anyother code is there ?
Thanks
karthik
 
SFDC developer999SFDC developer999
Yes, here is the code, I shortened some code. I guess the code is creating a new object, update a field that triggered an email alert.
so what to check if email is not sent in email alert ?

{!REQUIRESCRIPT("/soap/ajax/36.0/connection.js")}

if({!Objectxxx__c.Flag__c} == false)
{
if(confirm("message"))
{
var obj = new sforce.SObject("ObjectXXX__c");
obj.id = "{!ObjectXXX__c.Id}";
  ....
 
result = sforce.connection.update([obj]);
if ( result[0].getBoolean( "success" ) )
{

window.location.reload();
}
else
{
alert( result[0].errors.message);
}
}
}
karthikeyan perumalkarthikeyan perumal
Hello, 

Check is there any workflow rule  is associated with  this object 

Go to WorkFlow rule->select the Object-> if there is any workflow rule-> check there is any email alert immidiate action  when the field is updated or created time. 

Thanks
karthik
 
Gopal Zala 9Gopal Zala 9
How to pass a large number of selections Record ID from a standard lighting list view to a Visualforce page.selected ID from list will pass to page on button click
IS this possible in Salesforce Lighting lit page