You need to sign in to do that
Don't have an account?
kMans2k
Error with Delete Call
Hello all,
I have a s-control that brings-up a new html page when the corresponding button is pressed.
The Html page displays some details of a custom Salesforce Object using the onload event. It also contains a delete button that I am attempting to use to delete a custom Salesforce Object. Following is my code with irrelevant parts removed. If I have the code for "deleteForm" in, the page fails to load information about the object. If I don't, it does. This leads me to believe that something is wrong with the "deleteForm" code. Any help please?
<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/11.0/connection.js"></script>
<script src="/soap/ajax/11.0/apex.js"></script>
<script src="/soap/ajax/11.0/connection.js"></script>
<script src="/soap/ajax/11.0/apex.js"></script>
<script type="text/javascript">
deleteForm()
{
if( formId != "" ) {
String[] ids = new String[] { formId };
try {
DeleteResult[] deleteResults = sforce.connection.delete(ids);
}
catch( Exception e ) {
}
}
String[] ids = new String[] { formId };
try {
DeleteResult[] deleteResults = sforce.connection.delete(ids);
}
catch( Exception e ) {
}
}
}
loadForm()
{
var conn = sforce.connection;
var qr = conn.query("Select Id....");
var qr = conn.query("Select Id....");
var record = qr.getArray("records");
formId = record[0].get("Id");
formId = record[0].get("Id");
}
<body>
.....
<input type="button" name="deleteForm" value="Delete Form" onclick="deleteForm()" />
</body>
Hardhat
Did you try using firebug to find out exactly what the error is?