Check if an order is locked.

Discussions concerning general integration topics.

Moderator: Phil Barton

Post Reply
stanleyglass
Posts: 8
Joined: Thu Feb 02, 2023 10:43 am

Check if an order is locked.

Post 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;
            }
BobRichards
Posts: 1377
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Check if an order is locked.

Post 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.
Bob Richards, Senior Software Developer, SoftPro
Post Reply