• LeadFoot
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I'm attempting to use a Google Apps spreadsheet to display SF data, collect user input, and update SF records. It obtains data just fine, and executes the code that should update the SF data without error, but nothing changes in SF. Here's the code block that tries to update data in SF. Google's UrlFetchApp.fetch function does not accept the 'PATCH' method, so I use X-HTTP-Method-Override in the header. Any insight into why this silently fails? All of the authorization, SF Object Id, etc. is correct and works in a previous code block in the same function (not shown). 

 

My suspicion is that the X-HTTP-Method-Override doesn't work - it appears to behave as if the 'GET' method was specified, and if I add an explicit 'method : DELETE' to the options, it will delete the account record in SF even though X-HTTP-Method-Override still specifies 'PATCH".

 

  var queryUrl = "https://na9.salesforce.com/services/data/v20.0/sobjects/Account/001E000000L8FDGIA3";
  var payload = "{\"BillingState\":\"MO\"}";
  
  var headers = 
      { 
        "Content-type" : "application/json",
        "Authorization" : "OAuth "+accessToken,
        "X-HTTP-Method-Override" : "PATCH"
      };
    
  var options =
      {
        "headers" : headers,  
        "payload" : payload
      };
  
  var response = UrlFetchApp.fetch(queryUrl, options);

 

 

 

I'm attempting to use a Google Apps spreadsheet to display SF data, collect user input, and update SF records. It obtains data just fine, and executes the code that should update the SF data without error, but nothing changes in SF. Here's the code block that tries to update data in SF. Google's UrlFetchApp.fetch function does not accept the 'PATCH' method, so I use X-HTTP-Method-Override in the header. Any insight into why this silently fails? All of the authorization, SF Object Id, etc. is correct and works in a previous code block in the same function (not shown). 

 

My suspicion is that the X-HTTP-Method-Override doesn't work - it appears to behave as if the 'GET' method was specified, and if I add an explicit 'method : DELETE' to the options, it will delete the account record in SF even though X-HTTP-Method-Override still specifies 'PATCH".

 

  var queryUrl = "https://na9.salesforce.com/services/data/v20.0/sobjects/Account/001E000000L8FDGIA3";
  var payload = "{\"BillingState\":\"MO\"}";
  
  var headers = 
      { 
        "Content-type" : "application/json",
        "Authorization" : "OAuth "+accessToken,
        "X-HTTP-Method-Override" : "PATCH"
      };
    
  var options =
      {
        "headers" : headers,  
        "payload" : payload
      };
  
  var response = UrlFetchApp.fetch(queryUrl, options);

 

 

 

Is it possible to override standard field labels and make standard fields not required on page layouts?  For example, can the Opportunity Close Date field label be modified and not required?

 

Thanks.