function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rajeesh V R 1Rajeesh V R 1 

REST API: Create a single object record at a time

I have created a REST API to create an object record. But the requirement is only one record can be created at a time since we are using the API for financial application. So if multiple user are hitting the API simultaneously, I need to apply some kind of a queueing mechanism so that only one request will  hit to Salesforce. Is there a singleton mechanism available in Salesforce? Also please provide information on whether object locking is available in Salesforce? Any suggestion on how I can implement the above scenario will be much appreciated.
JSingh9JSingh9
you should be able to query existing furture/batch jobs in progress and queue the new opens till the first one is done. You may use CronTrigger, Queueable Apex to acheive it. Thanks