• HyTrust Support
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I am trying to use a custom button w/ JavaScript to execute a record update for users who would otherwise not be able to edit the record, due to permissions and record sharing.  However, when I click the button as a user without the proper edit rights on the record, nothing happens (except the page reload).  It works just fine when logged in as SysAdmin.
Is it possible to get the javascript to execute without regard to the logged in user's edit rights on the record?  If so, what am I missing?  Code is below:

{!REQUIRESCRIPT("/soap/ajax/34.0/connection.js")} 
var newRecords = []; 
var c=new sforce.SObject("Contact"); 
c.id="{!Contact.Id}"; 
c.Referral__c="True"; 
newRecords.push(c); 
result=sforce.connection.update(newRecords); 
window.location.reload();