Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JSforceでクエリ実行
<apex:page >
<apex:includeScript value="{!$Resource.JSforce}" />
<apex:form >
<apex:commandButton value=" Go!! " onclick="return doClick();" />
</apex:form>
<script>
var conn = new jsforce.Connection({ accessToken: '{!$Api.Session_Id}' });
function doClick() {
var soqlQuery = 'SELECT Id, Name FROM Account';
conn.query(soqlQuery, function(err, res) {
alert('2');
if (err) {
alert('NG : ' + err);
}
alert('OK : ' + res.records.length + ' Records');
});
alert('1');
return false;
}
</script>
</apex:page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.