Created
September 13, 2014 13:35
-
-
Save tzmfreedom/beea94c14a7f32f34a32 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 更新クエリ | |
*/ | |
function updateAccount() { | |
checkAuthorization(); | |
var prop = PropertiesService.getUserProperties(); | |
var sessionInfo = JSON.parse(prop.getProperty("session_info")) | |
//選択したセルがSalesforceのAccountIDであることを想定 | |
var accountId = SpreadsheetApp.getActiveRange().getValue(); | |
var res = UrlFetchApp.fetch( | |
sessionInfo.instance_url + "/services/data/v30.0/sobjects/Account/" + accountId +"?_HttpMethod=PATCH", | |
{ | |
"method" : "POST", | |
"headers" : { | |
"Authorization": "Bearer " + sessionInfo.access_token | |
}, | |
"payload": JSON.stringify({ | |
"Name": "GoogleAppsScriptによって更新!" | |
}), | |
"contentType": "application/json; charset=utf-8" | |
} | |
); | |
return res.getContentText(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment