How to remove entities from CustomDataSource

I'm using several CustomDataSources in my project. Each of them has several hunderts of assigned entities. Once in a while (3-5minutes) I have to updates the entities, some will have to be deleted, some are new and some are the same as before. To make it easy I would like to delete all entities of a CustomDataSource and add an updated set of entities afterwards. Whatever I try it seems to remove the complete CustumDataSource, not only the entities. I tried e.g. :


Thanks for your help.


Did you ever figure out your problem? If not, try calling entities.suspendEvents(); at the beginning of your update code just before the removeAll and then entities.removeEvents(); at the end. Ideally, you would not update your data by removing everything first because it causes a lot of extra work to be done, but the suspend/resume calls should at least cut down a lot of it.