When disallow concurrent execution is set to true, the microflow won't execute but it doesn't mean everything else will be rolled back. You can also choose to execute another microflow.
However I would try to solve this problem in the other system, it should not give out the same id twice if it also requires that the id's are unique. A simple select query might not be enough to solve this, you could consider atomically increasing and returning an id with a function or stored procedure.
I'm assuming your application is the only one requesting id's from the other application, because otherwise this whole thing wouldn't work anyway.
If changing the other system isn't possible I'm sure you could work something out, you could locally keep a static synchronized id and either atomically increase it there or at least check for equality after you retrieved an id from the other system. If your application is the only one requesting id's then I don't really see a reason to query the other system for every single id anyway.
If that doesn't work then you could disallow concurrent execution and perhaps create another microflow with a java action and poll the other microflow with a small delay until execution succeeds.
Hi Jonathan My guess is that in your situation, where the action is initiated from the client, not from a scheduled event, that the disallow concurrent execution option may only apply to the current client. That is it will stop a single user running it twice concurrently, but will not stop other users from running at the same time. Perhaps someone from Mendix can confirm or correct this.
In situations like this, I normally rely on logic on the external system to get a unique number similar to the Mendix autonumber attribute. I generate a UID (perhaps using RandomHash from Community Commons module) and submit a new record with the UID in one of the fields to the external system, which allocates the unique number to the new record. I then retrieve the number allocated using the UID as a query. If logic is in place on the external system to prevent duplicates, then I will always get the correct number. HTH