cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to remove all the records from OrderEntry, Order,CartEntry,Cart using Impex

former_member668022
Discoverer
0 Likes
5,176

How to remove all the records from OrderEntry, Order,CartEntry,Cart using Impex and what is the best practice to delete all old records.

Accepted Solutions (0)

Answers (1)

Answers (1)

StefanKruk
Active Participant
0 Likes

For this you can make use of the batchmode of Impex

REMOVE AbstractOrderEntry[batchmode=true];itemType(code)[unique=true]
;CartEntry;
;OrderEntry;

REMOVE Cart[batchmode=true];itemType(code)[unique=true]
;Cart

Important is here that you define something as unique for identification. With batchmode = true you specify that even if you find multiple Instances do the things for all of them.

former_member668022
Discoverer
0 Likes

Thanks Stefan. I will check.

former_member668022
Discoverer
0 Likes

Hi Stefan,

I tried for removing the OrderEntry records but getting the below exception. I have checked below PK values in HMC and BackOffice but couldn't find any record.

REMOVE AbstractOrderEntry[batchmode=true];itemType(code)[unique=true]
,8806760120366,,,item 8806760153134 no longer valid (was removed): object no longer valid, item 8806760120366 not found;OrderEntry;
,8806760284206,,,item 8806760316974 no longer valid (was removed): object no longer valid;OrderEntry;
,,,,;OrderEntry;
StefanKruk
Active Participant
0 Likes

The Media Objects were probably removed after the Impex Run was started and before the Object could be handled. Either someone else has deleted them during this time, another Automatic functionality in your hybris did it or something else has gone wrong (caching hybris/db, etc).

It also could be that the Objects had a part-of relation or were deleted with an RemoveInterceptor while deleting other Objects.

For Example if the Cart is deleted, the related CartEntry needs to be deleted as well. If one Thread is removing the Cart while the other Thread is removing the CartEntry this could lead to these Errors.

Please check if there are still Objects for the provided Types. If not then everything should be fine and you can ignore this error messages.