Hi-I’ve created a simple add-in to Notes in C that creates a new Contact in the contact list. If the Notes client is open, the new contact does not appear on the screen until I hit the F9 refresh key.
Is there a way to force the Notes client to refresh the view from within my C program?
which will bring the view up to date. To build the index from scratch, you can use OPEN_REBUILD_INDEX as the 4th parameter, but that shouldn’t be required, because a simple NIFOpenCollection will update the view automatically, if it changed.
You haven’t given enough info to suggest solution, no idea how you are integrating C-API with the Notes UI. Maybe it is possible to call your API code from LotusScript which can do the refresh after the C call returns.
Also, if i remember correctly, view export addins cause a view refresh so maybe thats an integration option.
I’ve created a small stand-alone C program that puts new contacts into the notes database using the C API. It links with various Notes DLLs. It must be able to run on its own, without a call from any script language or user input.
Here is the code snippet for adding a contact:
NOTEHANDLE hNewNote;
ret = NSFNoteCreate(hdb, &hNewNote);
ret = NSFItemSetText(hNewNote, "Form", "Person", MAXWORD);
ret = NSFItemSetText(hNewNote, "Type", "Person", MAXWORD);
ret = NSFItemSetText(hNewNote, "LastName", "Flintstone", MAXWORD);
ret = NSFItemSetText(hNewNote, "FirstName", "Fred", MAXWORD);
ret = NSFNoteUpdate(hNewNote, 0);
ret = NSFNoteClose(hNewNote);
I’m rather new at Notes development so please let me know what other information I can provide.
Thanks, Simon. I was afraid of that, but it’s not a showstopper. Any possibility that it can be done through the client’s COM interface? Have been browsing through the exported symbols but haven’t stumbled upon anything just yet. Documentation is scarce.