I believe there are other solutions available as well. In my case, since the record gets created in the background via a Web API call, I incorporated the sorting code within the success method of the API, and that worked for me. You might consider adding a wait condition to see if that helps, although it's not the most ideal solution.