Is there some way to disable the user confirmation on softDelete? |
Re: softDelete User Confirmation
|
Re: softDelete User Confirmation llandale - Thu Dec 10 18:40:08 EST 2009
int lDeletedObj = 0
Object lObject = null
for lObject in mDeleteList do
{
if ( lObject != null )
{
if ( table( lObject ) )
{
deleteTable( lObject )
}
else if ( row( lObject ) )
{
deleteRow( lObject )
}
else if ( !cell( lObject ) )
{
softDelete( lObject, true )
}
lDeletedObj++
}
}
|
Re: softDelete User Confirmation Matthew Dunn - Fri Dec 11 13:30:34 EST 2009
int lDeletedObj = 0
Object lObject = null
for lObject in mDeleteList do
{
if ( lObject != null )
{
if ( table( lObject ) )
{
deleteTable( lObject )
}
else if ( row( lObject ) )
{
deleteRow( lObject )
}
else if ( !cell( lObject ) )
{
softDelete( lObject, true )
}
lDeletedObj++
}
}
Of course, as soon as I post a reply, I figure out what I needed. The second parameter is what was causing the confirmation dialog I think. However, I couldn't get my method to work without it, until I realized I was trying to delete items that were already deleted (I had deleted the ancestors already). Here is my solution if anyone is interested:
int lDeletedObj = 0
Object lObject = null
for lObject in mDeleteList do
{
// We check if the object has been deleted, because it's possible that the object may have
// already been deleted in a previous loop
if ( ( lObject != null ) && !isDeleted( lObject ) )
{
if ( table( lObject ) )
{
deleteTable( lObject )
}
else if ( row( lObject ) )
{
deleteRow( lObject )
}
else
{
softDelete( lObject )
}
}
lDeletedObj++
}
|
Re: softDelete User Confirmation Matthew Dunn - Fri Dec 11 13:44:29 EST 2009
Of course, as soon as I post a reply, I figure out what I needed. The second parameter is what was causing the confirmation dialog I think. However, I couldn't get my method to work without it, until I realized I was trying to delete items that were already deleted (I had deleted the ancestors already). Here is my solution if anyone is interested:
int lDeletedObj = 0
Object lObject = null
for lObject in mDeleteList do
{
// We check if the object has been deleted, because it's possible that the object may have
// already been deleted in a previous loop
if ( ( lObject != null ) && !isDeleted( lObject ) )
{
if ( table( lObject ) )
{
deleteTable( lObject )
}
else if ( row( lObject ) )
{
deleteRow( lObject )
}
else
{
softDelete( lObject )
}
}
lDeletedObj++
}
Actually this really isn't unusual. Verbalizing your problem so that someone else can understand it often clarifies it better you your mind, letting you solve it for yourself. Its a good trouble shooting technique, just don't hit the Send button right away. |
Re: softDelete User Confirmation Matthew Dunn - Fri Dec 11 13:30:34 EST 2009
int lDeletedObj = 0
Object lObject = null
for lObject in mDeleteList do
{
if ( lObject != null )
{
if ( table( lObject ) )
{
deleteTable( lObject )
}
else if ( row( lObject ) )
{
deleteRow( lObject )
}
else if ( !cell( lObject ) )
{
softDelete( lObject, true )
}
lDeletedObj++
}
}
I don't know if you delete single cells (not just entire rows), but the code should fail, when you delete a single cell, since nothing happens in this case, except the deletion counter is increased. So you might want to remove the "if (!cell lObject)" ... Regards, Mathias |
Re: softDelete User Confirmation Mathias Mamsch - Fri Dec 11 18:03:20 EST 2009 |