Smartlists and deletes

Das Goravani goravanis at gmail.com
Fri Jul 15 20:07:28 UTC 2022


In other words does this code work, is it sufficient to delete all line items associated with the invoice in iInvRow with ID inv_id

It’s the logic of when I declare it to be a smartlist, how I already have it loaded with rows, at the time it is declared to be smartlist, does that make them "records" to the smartlist?

Thus if I simply remove them then $dodeletes will delete them?

And does this For loop work?


# Delete the line items associated with this invoice

Do iLineItemsList.$clear()
Do iLineItemsList.$smartlist.$assign(kFalse) ##To clear the Hist.List if it was already used
Do iLineItemsList.$select('WHERE line_inv_id=[iInvRow.inv_id]')
Do iLineItemsList.$fetch(kFetchAll)
Do iLineItemsList.$smartlist.$assign(kTrue)
For iLineItemsList.$line from 1 to iLineItemsList.$linecount step 1
Do iLineItemsList.$remove()
End For
Do iLineItemsList.$dodeletes()


More information about the omnisdev-en mailing list