Page 1 of 1

Check if an order is locked.

Posted: Fri Feb 10, 2023 11:48 am
by stanleyglass
Is there a way to see if an order is locked before I try to edit it in my code? If for any reason my code errors out and does not fully complete the order is locked or in the event I need to update a record that a user has open?

Code: Select all

            var search = os.Orders.FirstOrDefault(t => t.Number == spec.BaseNumber);

            if (search == null) return os.NewOrder(spec);
            try
            {
            //can i check for the order being locked here before returning?
                return os.OpenOrder(search, OrderEditMode.ReadWrite);

            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }

Re: Check if an order is locked.

Posted: Fri Feb 10, 2023 4:29 pm
by BobRichards
There is no way to determine if the order is already opened by someone that I am aware of. I have asked R&D if they have a method. I'll let you know when they report back.