You are viewing limited content. For full access, please sign in.

Question

Question

ILFEntry IsLocked returning wrong value

SDK
asked on August 18, 2014 Show version history

I am reading the IsLocked (boolean) value of a document, which is open in edited mode and has a LOCK on it (I can see the lock in LF Client as well as under Admin console) but the return value is false (instead of true). I am sure that it has picked-up the right document but just not getting the right IsLocked value. Any ideas?

 

ILFEntry EntryHit = (ILFEntry)Hit.Entry;

                    int DocID = EntryHit.ID;
                    if (EntryHit.IsLocked)
                    {
                        MessageBox.Show("Entry is Locked: " + DocID);
                    }

In the above code, Hit is a 'LFSearchHit' type.

0 0

Answer

SELECTED ANSWER
replied on August 18, 2014

The documentation is misleading, IsLocked returns whether that particular ILFEntry object holds the lock (i.e you locked it with that object). To see if the entry is locked at all, check the COLUMN_TYPE_LOCK_TYPE column on the search listing (you need to add it to the SearchListingParams object before retrieving the search listing). The column is an integer, 0 = not locked, 1 = short term lock (e.g. the document is modified in the metadata dialog), 2 = persistent lock (the document is checked out). You can also get this column with ILFDatabase.GetSingleEntryListingById.

1 0
replied on August 18, 2014 Show version history

Robert,

All working now. Thanks

 

LFSearchListingParams NewParams = new LFSearchListingParams();
                    NewParams.AddStandardColumn(Column_Type.COLUMN_TYPE_LOCK_TYPE);  

LFSearchResultListing ResultListing = (LFSearchResultListing)DocSearch.GetSearchResultListing(NewParams, 0);

string isLockedValue = ResultListing.get_DatumByColTypeAsString(i, Column_Type.COLUMN_TYPE_LOCK_TYPE);

 

0 0

Replies

replied on August 18, 2014

That's what the documentation says about ILFEntry:

 

IsLocked as Boolean Returns a Boolean indicating whether the document is locked.  
0 0
replied on August 18, 2014

Thanks Robert. I will give it a try.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.