• Dave Snow
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    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();

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();

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();