I have tried the following:…
LNItem item;
LNText text;
note.GetItem(“$FolderRef”, &item);
if( !item.IsNull() )
{
text = (LNText) item; (Fails here)
…
I have also tried LNItem.Read, but no luck.
Need help from the C++ API team, or the C++ gurus out there.
Thanks,
Radhika
Subject: How to read ‘Response Reference List’ type field using C++ API
You can’t. What’s you’re looking for is a TYPE_NOTEREF_LIST (see CAPI), The API know’s that this is not a LNText object. You can get a list of Responses and such via the LNDocument object.
You’ll want to use the CAPI with the C++ to get direct access to the data (please see the C API reference document for more information).
Try using
the LNDocument object
LNSTATUS GetAllResponses( LNDocumentArray *responses ) const
LNINT GetResponseCount () const
etc.
Subject: RE: How to read ‘Response Reference List’ type field using C++ API
Well you can do it as Steve mentioned (Combining C and C++ API). Here is another way to do the same without changing your current project. I think you are trying to get the folder of a mail document (For this you need to have the folder references enabled), I can understand the frustration, well lotus doesnot provide any functions like Doc.GetFolder() or Doc.IsRead() or Doc.markRead(). The reason being, folders contain docs and unread list contain docs, rather than these being a propery of the Document Object. We can’t blaim Lotus as they have to be backward compatible (That also means that they have to support the flaws in the design that they made earlier). Anyways, I will let Steve answer this question which might help you: “How come ‘restore’ from ‘$(SoftDeletions)’ view (When softdeletes are enabled) work even if folder references are disabled?”.
Anyways, here is a way to achieve what you needed.
…
LNFormula formula;
LNItem result;
LNText text;
LNDocument lnDoc;
LNItem textItem;
… Get the DB and lnDoc
try
{
//Now get folder ref id of the mail item
if ( 0 == lnDoc.GetItem( “$FolderRef” ,
&textItem ) )
{
formula = LNFormula( "@Text($FolderRef)" );
formula.Evaluate( &result, lnDoc );
text = (LNText) result;
text.GetText( &idString );
}
…
G’Luk
Sunil
Subject: Re: (To Steve Chin) …How to read ‘Response Reference List’ type field using C++ API
Sunil, Thanks a lot. That solved my problem but as you said, forcing admins to enabling folder references is my concern. Steve could you please answer this question:
“How come ‘restore’ from ‘$(SoftDeletions)’ view (When softdeletes are enabled) work even if folder references are disabled?”.
I want to use the C++ API, to find the folder that the mail document belongs. Opening each folder and trying to find if the document is in that folder is not an option, please help.
Thanks,
Radhika