Created
March 28, 2014 12:21
-
-
Save setap/9831465 to your computer and use it in GitHub Desktop.
HP Service Manager How to check if record is locked
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function isLockedByOperator(resource,operator) | |
| { | |
| var locks = system.functions.locks(); | |
| for (var i=0;i<locks.length();i++) | |
| { | |
| var lock = locks[i].toString().split(",") | |
| var tempOperator=lock[3].substring(2,lock[3].length-1); | |
| var tempResource=lock[4].substring(2,lock[4].length-1); | |
| if(resource==tempResource) | |
| { | |
| if(operator!=null) | |
| { | |
| if(tempOperator==operator) | |
| { | |
| return true; | |
| } | |
| else | |
| { | |
| return false; | |
| } | |
| } | |
| else | |
| { | |
| return true; | |
| } | |
| } | |
| } | |
| return false; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment