How to check for the modules which are been locked in exclusive edit by modules in the project?

Hello All,

I have got stuck with the two requirements in one of the tool:

1.) I have two check boxes (E.g: Checker, Enabled) in the tool.If the user checks the first check box(Checker), it should open all the modules in read only mode for the project.

2.) If the user check the second check box(Enabled), it should open all the modules inside the project in Exclusive Edit mode.

------If the particular module is opened in exclusive edit by some other user, it should give intimation to the user who has opened and what module it is.

Please help me out.

 


KBSri - Thu Feb 12 11:58:57 EST 2015

Re: How to check for the modules which are been locked in exclusive edit by modules in the project?
GregM_dxler - Fri Feb 13 09:22:34 EST 2015

Would this work?

Lock lockItem 
string username 
ModName_ thisModule = module (fullName current Module)
bool noUsers = true
 
LockList lcklist = getLocksInModule(thisModule, true)
 
for lockItem in lcklist do { 
    username = lockItem.user 
    print "User has lock: " username " on module " fullName(current Module) "\n"
    noUsers = false
}
if(noUsers) print "No users have a lock on the module."

Hope this helps,

Greg