Created
September 6, 2014 07:35
-
-
Save tyoshikawa1106/6d7d74575eda8452040b to your computer and use it in GitHub Desktop.
Remote Objects Delete
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
<apex:page standardController="Account" showHeader="true" sidebar="false" id="page"> | |
<apex:include pageName="RemoteObjectsDeleteRemote" /> | |
<div id="vf-page"> | |
<apex:form id="form"> | |
<apex:commandButton value="Delete" onclick="return deleteAccount('{!Account.Id}');" /> | |
</apex:form> | |
</div> | |
<apex:include pageName="RemoteObjectsDeleteScript" /> | |
</apex:page> |
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
<apex:page > | |
<apex:remoteObjects > | |
<apex:remoteObjectModel name="Account" fields="Id" /> | |
</apex:remoteObjects> | |
</apex:page> |
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
<apex:page > | |
<script type="text/javascript"> | |
function deleteAccount(prmAccountId) { | |
var account = new SObjectModel.Account(); | |
account.del(prmAccountId, function(err, results) { | |
if (err) { | |
alert(err); | |
} else { | |
location.href = "/" + results; | |
} | |
}); | |
return false; | |
} | |
</script> | |
</apex:page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment