Lock a document(please help)

Hi please help urgently,

How do I lock a document by the current user and then unlock it.

Subject: lock a document(please help)

Hie

To lock/Unlock doc, you need to tackle using JS & LS.

  1. OnLoad call an agent using JS function. (?openagent&ID=…&UserName=…)

  2. Have a view to store all docs that are being currently edited, i.e. locked docs.

  3. Referring to step 1, using agent, check whether you already have a doc. with the same combination of DocID+Username. If Yes, dont allow user to edit doc. & display customised msg instead. If not, then create a doc. with Doc ID+Username combination.

  4. Suppose in this agent you din’t find any doc. – means it is not locked by another user, you create one lock doc. & onUnload delete the locked doc created.

Hope this helps you…

~Cheers

Subject: lock a document(please help)

If you want to use formula language, you have the following functions for locking and unlocking as:@DocLock([LOCK])

@DocLock([UNLOCK])

Note: You need to enable the check box in the database properties for “Allow Document Locking”