You need to sign in to do that
Don't have an account?
RobinHood
Deleting from the database SOQL
Hi,
I want to delete the record returned from the following query, how do I delete it ?
//To remove property from the database
function removePropertyFromDB(propertyId, PreviewListId){
var unWantedPropSql = sforce.connection.query("Select Importance__c, MLSProperty__r.Name, Preview_List__c From Preview_List_Property__c p where MLSProperty__r.Name = '" + propertyId + "' and Preview_List__r.id = '" + PreviewListId + "'");
}
//the above query returns 5 rows of record, how do I delete these rows ? pls help me out !
Thanks,
Suresh
List<Preview_List_Property__c> forDelete = [Select Importance__c, MLSProperty__r.Name, Preview_List__c From Preview_List_Property__c p where MLSProperty__r.Name = '" + propertyId + "' and Preview_List__r.id = '" + PreviewListId + "'"];
delete(forDelete);
I'm getting the "Invalid assignment left-hand side' error...
You need to query the object for the Id's of the records you want to delete, add these Id's to a list, and then do a delete (listName).