We are using Custom Objects for our app. As per the documentation, the display_id of a record should be unique and the creation of display_id will be taken care of by the product.
When we created records in custom objects, for all the records we received the same display_id.
For example, a process happens on our app and during the process, the app will create records in Custom Object. In a single process, more than 20 records will be created in less than a minute time.
Why does the display_id not being unique in this case? What we are doing wrong?
Hi @arshath.h,
I tried to replicate the scenario by creating the records in a loop within a window of 1 second. As you can see the display_id seems to be duplicate like you mentioned.
I then attempted to wait for every record creation by using async … await pattern and it seems to work fine I would recommend waiting for the creation operation’s competition before the next one begins. This can be achieved with the aforementioned async … await / Promise.all[…] patterns.
The FDK tries to simulate the actual custom objects service locally using SQLite. It is likely that it creates a duplicate in certain situations due to the way it mimics the display_id generation
Say, display_id = max(previous display id) + 1 & unfortunately 5 operations grab the same value before any of them get a chance to update it back!
This behavior would not be noticed in production as the underlying service ensures uniqueness ! Regardless, I have noted this issue in FDK and will share it with the team for broader attention.