Forum Discussion
Hello,
Did you try to set the action as 'unlock' like in the example below?
[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:c5732f46-03d3-4bd1-a18e-291f61ef1e67:type=csharp&text=Item%20myItem%20%3D%20inn.newItem%28%22MyItemType%22%2C%20%22unlock%22%29%3B%0A%2F%2F%20or%0A%2F%2F%20myItem.setAction%28%22unlock%22%29%3B%0AmyItem.setID%28%22myId%22%29%3B%0AItem%20unlockedItem%20%3D%20myItem.apply%28%29%3B%0Aif%20%28unlockedItem.isError%28%29%29%0A%7B%0A%20%20%20%20return%20unlockedItem%3B%0A%7D]
Additionally, you can try something like this
[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:902ee7c5-32da-46e1-a118-4165b85f9a16:type=csharp&text=%2F%2F%20Imagine%20that%20you%20already%20have%20the%20item%20to%20unlock%2C%20i.%20e.%20myLockedItem%0AItem%20unlockedItem%20%3D%20myLockedItem.apply%28%22unlock%22%29%3B%0Aif%20%28unlockedItem.isError%28%29%29%0A%7B%0A%20%20%20%20return%20unlockedItem%3B%0A%7D]
I just tried your second technique there with an existing Item and it appears to have the same behavior as my code.
What is does is after the method is ran the user can update the item and save it. Once they close the item (with it saved and still locked) it will then unlock to the system.
Basically I am trying to re-create what happens when a user is working on an item, then an admin locks their item (takes it away) then once they try to click, save, discard, etc it puts them into a core lock state. So after the method is run they could not edit it in anyway.
Thank you for your help, I did not think of doing it that way.