Unlock Business Object

A business object can be unlocked using either the Unlock command or the Checkin command.

The Checkin command is used when you are associating files with the object (for more information, see Checkin Business Object). The Unlock command removes a lock from a business object:

unlock businessobject OBJECTID [comment TEXT];

  • OBJECTID is the OID or Type Name Revision of the business object.
  • TEXT is a special message sent to the original lock holder.

When this command is used, MQL checks for a lock on the object. If there is an existing lock, and you are the user that locked the object, the lock will be removed from the object. If you are not the User that locked the object, MQL will check for Unlock access and will unlock the object only if you are entitled to do so.

After the lock is removed, other users can apply new locks to obtain exclusive editing access. For example, the following commands remove the exclusive editing lock from the Bran Cereal business object:

set context user Barbara password “Van Gogh”;
unlock businessobject “Box Design” “Bran Cereal” A;

The first command sets the context and identifies the person removing the lock. This must be the same person who placed the lock on the object or someone who has unlocking privileges. The second command unlocks the object. Unless Barbara or someone with unlocking privilege removes the lock, no one else can alter the object’s contents.

Under some circumstances, it might be necessary to have someone other than the lock owner remove the lock. For example, in the case of extended illness, a manager might decide to have someone else edit the object. When the manager removes the lock, the original lock owner will receive a message (IconMail) that the lock was removed. If desired, an additional message can be sent along with the notification. This is the purpose of the Comment clause of the Unlock command.