Using ID Column in Microflow

2
HI, Is there a way to use the ID column (automatcially created for an entity) in a Mendix microflow.  I would like to delete data from a huge table and like to perform this operation in asynchromous batches based on this ID. Any help in this regard is appreciated. Thanks, Aravind
asked
2 answers
5

Community Commons module has a Java action called getGUID that will get the GUID for any Mendix object.    This would enable you to get the GUID for all the objects you would lke to delete.  However, as far as I know, there is not pattern to GUIDs...so I am not sure this will be helpful in creating batches.  

In addition to the batch Java actions Mitchel mentioned, you could also use limit and offset in retrieves to create a batch processing capability.  See  https://world.mendix.com/display/howto40/Retrieve+and+manipulate+batches+of+objects for more information on this.  You could create a microflow that deletes a certain number of these records and set it up as a Scheduled Event that runs periodically until all of the records you want to delete are gone.

answered
3

Only option I know is using a Java action to extract this ID which using the function getID() for example:

 

Source.getId().toLong()

 

But you could also use the community commons batch java actions in combination with a limit retrieve.

Hope this helps.

answered