Trap whether the document can be edited

Is it possible to trap whether the document can be edited?

e.g. If someone else has a softlock on the document, then just display the message saying that and no other error message…

Like this:

@IfError(@Command([EditDocument]);@Return(“”));

(but that doesn’t seem to work!)

Or made up @Command: @IfDocumentIsAvaliableToEdit ?

Subject: Trap whether the document can be edited

Can you use @DocLock (or LockHolders property of the NotesDocument class) in a conditional statement?

Subject: RE: Trap whether the document can be edited

In general yes, in my case no, because document locking is not enabled (nor is it going to be)

Subject: RE: Trap whether the document can be edited

Sorry, did not see that this application was using soft locking. Perhaps the solution listed here may help

https://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/dae3c98ab56b58d98525706200747c35?OpenDocument

Subject: RE: Trap whether the document can be edited

Thanks Mark,That works a treat (tho somehow seems like a workaround!!)

Anyway, here is the finished code:

FIELD OpenforApproval:=OpenforApproval;

@SetEnvironment(“OpenforApproval”;“Yes”);

@Command([EditDocument];“1”);

@UpdateFormulaContext;

@If(!@IsDocBeingEdited;

@Do(@SetEnvironment(“OpenforApproval”;“”);

@StatusBar(“Sorry, document cannot be edited. Please try later!”));

@Do(

@Command([ViewRefreshFields]);

@Command([RefreshHideFormulas]);

@Command([RunAgent];“Refresh Document1”);

@If(MainProjectPhase=“Project Inception” & RACIupdate!=“Yes” & RACIStatus!=“Proposal”;

@Do(

@Command( [SectionExpand] );

@Command([FileSave]));

@Command([FileSave]))))