cancel
Showing results for 
Search instead for 
Did you mean: 

item delete

Former Member
0 Kudos

Hi, is there a flag in the oitm table or any other table that shows which items can be deleted? I want to right a query containing all the items that can be deleted.

thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

If you eliminate the items to dele from some selects from oinv, ordr, ... tables then you may delete it through getbykey method and .delete When there exists some movement or relationship, the delete action will throw error, so you cannot worry, that you delete something with relationship.

Former Member
0 Kudos

OK this is the thing:

I have develeped an add-on that uses the SDK to delete Items. It works fine and it only deletes items that can be deleted since it performes all the checks that SBO uses. I would however like to have a list of all the items that can be deleted so that I don't waste time trying to delete items that cannot be deleted.

Former Member
0 Kudos

Costas,

thats I wrote you already. If you make select from orders, invoice and so on fot itemcodes and then select from OITM where itemcode not in (result of your select), you will eliminate lot of items. Of course, there may exist some item which cannot be deleted, but that will be not big quantity.

If you want to be sure, that all items may be deleted, make select from all tables where field itemcode exists, you may create select from information_schema.fields where filedname like '%itemcode%', but if zou dont have thousand of items, the selct from main tables like ordr, oinv, ... will be enough.

Petr

Former Member
0 Kudos

Thanks. I had this in mind, but I just wanted to know if there was a flag somewhere that shows if an item can be deleted. I didn't think SBO would perform a complex check each time you try to delete an item, it makes much more sense for them to have a flag somewhere, but aparently not.

Thank you all for your feedback.

Former Member
0 Kudos

There is no flag in OITM table. When you tried to delte it through SBO application, it will check all necesary tables.

If you want to know, which all tables is SBO checking, use SQL profiler before deleting and you will know exactly, what SBO checks.

Petr

Former Member
0 Kudos

thanks

Former Member
0 Kudos

Καλησπέρα Κώστα,

What exactly would you like to do on order to delete entries from the OITM table,

Be aware that the item tables have many relationships with other tables, for example, OITM links with OITW and ITM1 and with the additional AITM AITW and AIT1(history tables), and with the document tables and many others(OINM) etc...

If you can give me more info....

Regards

Georgex

Former Member
0 Kudos

You may delete item without any movements, so youll have to check orders, invoices, ...

So you must create select from all this tables.

Petr