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

custom button send email, insufficient privs

2 issues.  

#1 as an admin user the code below works fine.  If my Tier 2 guys try it, it says insufficient privs.  They do have the Send Email permission.  The Standard Send Email button in Accounts >Activities works fine.

#2 If I click the email button, and decide to cancel, it still makes the changes.  How do I account for cancelling?  
var solObj = new sforce.SObject("Solution"); 
solObj.Id = '{!Solution.Id}'; 
solObj.Status = 'Needs Update';
solObj.IsPublished = false;
solObj.Approved_checkbox__c = false;


Cyrus TalladenCyrus Talladen
What I would do, since you seem to have a custom button, is to make another custom cancel button which redirects back to the record detail page using javascript

similar to what this custom button was doing but not making any updates, just redirecting.

Cyrus T
@Cyrus Talladen according to SF you can't edit the Send an Email layout that the URL calls so creating a custom Cancel button will not work.  Any other suggestions?
Cyrus TalladenCyrus Talladen
You can add javascript logic to your custom button, may a confirmation popup that says "Do you want to update the information?" and "Yes" would make the changes, and "No" would cancel the action.

Cyrus T