You need to sign in to do that
Don't have an account?
Unable to Delete - SOQL - Passing Parameter through a function
Hi,
I'm trying to delete a record from the object Preview_List_Property__c by passing the parameter (propertyId)
below is my function, but the record corresponding to the propertyId is not getting deleted.
Any thoughts on this ?
function removeFromTheDB(propertyId){
var unWantedPropSql = "Select Importance__c, MLSProperty__r.ID, Preview_List__c From Preview_List_Property__c p where MLSProperty__r.ID = '" + propertyId +"'";
var unWantedPropResult = sforce.connection.query(unWantedPropSql);
var unWantedPropResultArray = unWantedPropResult.getArray("unWantedPropResultArray");
sforce.connection.deleteIds([unWantedPropResultArray]);
}
Thanks,
Suresh
you should be using
sforce.connection.deleteIds([unWantedPropResultArray.id]);