How do Lotus Notes documents arise with document versioning enabled? - lotus-notes

In several mail-in and regular databases we have documents that appear to be "uneditable" - i.e. edit them and the edits appear not to save. In fact what is happening is that both the original and the edited doc are being saved because something has switched on "versioning". Needless to say this confuses users quite a lot.
It appears you can only tell versioning is enabled by looking inside the document properties for a field called $VersionOpt.
The form designs have versioning set to None, so something must be setting $VersionOpt.. but what might do that? Is there anything in a regular 8.5.3 mail client that sets document versioning? Any other ideas how this can happen?
(This link explains the background to Notes versioning - http://gg-lnotes.blogspot.co.uk/2010/04/ways-to-do-version-controllingtracking.html)

Based on the comments, my best guess is that you have one or more users drafting their messages in a Notes application built with a template that supports versioning (possibly the Document Library, but it could be something custom) and using a programmed action that calls #MailSend to submit them to the mail-in database. That's going to take the note intact, add the required fields (e.g., SendTo, etc.) for mailing, and drop it into mail.box, complete with all items that the application template's code had created.
(The only other possibility I can conceive of is that you have some add-on software on one of your servers that is hooking the router and adding the $VersionOpt item based on something it sees in certain messages, but that seems very far-fetched. I've never heard of a mail add-in that would do that.)
In any case, the solution to the problem would be to add an agent to the mail-in databases, triggered by the "Before new mail arrives" event, to remove the item. I.e., FIELD $VersionOpt = #DeleteField;

If a user creates a Notes 'memo' message using 'stationery', the new note can be created with a version control field. If this Notes 'memo' is then mailed in to the mail-in db, it will recieve the message with the version control field '$VersionOpt'. See this answer in an old forum post:
http://www-10.lotus.com/ldd/nd6forum.nsf/ShowMyTopicsAllFlatweb/92a576fbe203b781852573af00630b78?OpenDocument
There are also old technotes referring to this issue.
The solution is to delete the field using a background agent or otherwsie arrange to delete the field.

Related

Lotus script agent does not make any update when ran from an Embedded View in lotus notes

I have an embedded View within my form which has a bunch of agents in the embedded view.
However when i select rows(documents) in the embedded view and run the agent (eg "Do a multi profile update") it does work but it does not make any changes to the documents selected. Like the prompt in the lotus script agents does work and pop up but no updates are made.
When ran externally from the view it works fine so for some reason it does not work from an embedded view is what i feel.
The agent within the view is an Action which uses a formula language code #Command([RunAgent];"updatePeople")
were the updatePeople is a lotus script agent.
any ideas or suggestions guys?
I think you have to access the selected documents using an action in the embedded view with the LotusScript logic inside the acrtion instead of calling agents. You can find a complete answer here (with full explanation and code sample):
Domino Designer: Access selected rows from embedded view
I am not sure if this IBM TechNote explains exactly the same issue, but it seems very similar:
How to get a handle on selected documents in an embedded view when using LotusScript
Does the ID have the correct ACL settings for the agent to run?
Does the ID have the ability to edit documents?
Does the Agent have the proper save statements in the code?
The example code in the above link is doing a full db search of unprocessed documents. I would suggest using the ViewEntry document collection. This will allow the agent to run faster since the view could be customized.
Another way to go if you are having issues with processing is to set up a flag field that is updated with the save of your document. The flag field could be used in your view selection field to have the documents fall out of the view if that is desired.

Xpages ACL validation from the XSP document level

Is it possible to validate the Xpage's ACL depending on the Source document's field value.
We need to make the Authors & Readers ability at XPage level (as per requirement I am not supposed to use the ROLES, since, it is dependent on each individual Authors which is stored in backend document FIELD).
Kindly suggest the approach, as I am not even looking HideWhen for the Buttons(edit,save etc)
Example code in the ACLEntry[0] in Xpage:
if getComponent("inputText1").getValue() == sessionScope.user {
session.getEffectiveUserName();
} else {
return false;
}
Thanks.
I do not quite understand your code on that property...
To query the readers/authors level at XPage level I suggest to use the database.queryAccess method (http://www-10.lotus.com/ldd/ddwiki.nsf/dx/NotesDatabase_sample_JavaScript_code_for_XPages?opendocument&comments#queryAccess)
You try to compare the username only. This may fail if your access level is computed by a membership in a group where your username is not relevant.
XPages' ACL depends on the database ACL, so you have to setup the levels there - the XPages' ACL is in addition to the "real" ACL as far as I experienced.
I also experienced that readers fields affect the ability to use an XPage to open a document by default.
I hope my answer is not too confusing ;-)
I think the question is valid (to my current knowledge):
If I want to design a workflow application but the current approver should not edit the full document I want to give him only access to parts (ie. a comment field and the approval button).
The question above relateds somehow to access controlled sections in old LN development. I so far also didn't find a good solution
What you describe is a very common workflow scenario. There are several ways how you can implement that efficiently. Here is what I would do:
Have one (or more) custom controls that render the "payload" (the fields the requester fills in)
assemble them into one bigger control that is used to render the form
compute the mode to read/edit depending on who is opening the form and the mode (new, pending approval, approved, rejected etc.)
Optional: when submitted remove submitter from the author field
Have one "Approval Control" that show only when the current user is the (current) approver and status is "pending approval" That control has fields that are NOT bound to the document, but a scope variable
The approval button triggers SSJS that takes the scope variable values and updates the document (and triggers notifications, access change etc)
The approval component can be used for any approval form. You then can contemplate not to give the approver write access since you could handle that in code.

Remove note's autosave functionality by adding other entity's notes on form in CRM 2011

In CRM 2011, notes get automatically created and attached to main record on lost focus event. Requirement is to remove this auto save functionality. Only till main form is open user should be able to edit notes. And newly added notes should only get saved once main form is saved. For example, if user add one note and closes the browser or do not save the main form, then that note should not get attached to main record, new note should get discarded.
I was thinking following solution:
create new custom entity TempNotesHolder
Create 1:N relationship with the entity where we want this functionality, for example Case entity
Make actual case's note section read only(it is requirement, user don't want to edit/delete functionality for notes once note get created)
Write plugin for create event of Case and create one Record for TempNotesHolder and associate it with case(RegardingId field in TempNotesHolder = incidentId) This will ensure one Case will always have only one associated TempNotesHolder record. There is no way in CRM 2011 to ensure One entity record will have only one record in associated entity i.e. 1:1 relationship. At least I don't know the way. Let me know if any one are aware about it.
On Case form, add one IFrame below Case's note section
on case form load event, get TempNotesHolderId associated with case using fetchXml.(There is no actual field in Case entity that refer to associated TempNotesHolder, hence need to use fetchXml. Some how we can add associated TempNotesHolderId to Case entity, and place that field on Case form, make it hidden, to avoid fetchXml)
Prepare url to display only notes of TempNotesHolder record.(/_controls/notes/notesdata.aspx?EnableInlineEdit=false&EnableInsert=true&id=&ParentEntity=
Set this url to newly added IFrame, so notes of associated TempNotesHolder get displayed in IFrame. It will also have link "Add New Note".
User can add note to TempNotesHolder which are not directly added to Case record.
Next develop plugin on pre save event of Case and check if there are any notes added to TempNoteHolder, if yes move those notes to Case record, and delete notes for TempNoteHolderId. This way notes will get saved to main record only on main form save.
To handle browser close event after adding few notes to TempNotesHolder, write plugin on Case pre Retrieve event, check if any notes present for associated TempNotesHolderId, if present then delete those notes. (As notes are present on TempNotesHolderId, that means due to some reason these notes are not moved to actual case record and we no longer need them, so delete them. This will ensure on case load, TempNotesHolder note section always be blank)
The above solution was fine till step 8. When I tried to add notes in TempNotesHolder, it gave me error, "Record with does not exists in TempNotesHolder". Then I checked that GUID, I disappointed to know CRM is taking IncidentId when I create note for TempNotesHolder. Then I tracked down the actual code for create notes to find why it is taking IncidentId instead of TempNotesHolderId. I found following code in "_static/_controls/notes/notes.htc" function name "UpdateNote"
xml="0"+CrmEncodeDecode.CrmXmlEncode(value)+""+_parentCrmFormSubmit.crmFormSubmitId.value+""+this.parentEntityType+""+CrmEncodeDecode.CrmXmlEncode(currentTitle)+""+this.userId+""
CRM is taking _parentCrmFormSubmit.crmFormSubmitId.value as objectid while creating note.
Now I stuck with this problem. Any thoughts to overcome this show stopper issue are appreciated. Also any other alternate solution to main requirement are also welcome.
Pravin Pujari (Microsoft Dynamics CRM 2011 Developer)
I would suggest simplifying the solution as follows:
Add a field to Case called new_notetext.
Create a Plugin against the Pre-Create and Pre-Update messages on the Case entity.
In the plugin, take anything entered into new_notetext and add a note to the Case entity using that text. Then clear the field new_notetext so nothing is saved with the record.
Should work just fine and is much simpler to implement.

Custom memo field isn't copied to Reply or Forward in Lotus Notes 6.5

I work in a development/support team which has a shared Lotus Notes mailbox. We need to be able to associate an issue ID with each email. We started by adding this ID to the subject line (eg. "Something doesn't work [ID12345]"). For performance reasons, our IT dept don't allow indexing of shared mailboxes, so it takes a long time to search for a particular ID.
I decided to add a new ID field, which can be shown as a sortable column in views and folders. I put this field to the visible header (just below 'Subject') in the ($All) view and the ($Inbox) folder, and copied the ($Inbox) design to all the other folders in the database. That much was easy.
My problem is that when we reply or forward, this custom field is not carried over to the new memo, so we have to manually add it again before sending. And of course when the user responds, the field is again missing and must be manually added. I have searched the docs and the internet and haven't found any information on this. Either I have to declare this field as something which persists across replies and forwards, or I have to add a line somewhere which explicitly copies the field contents to the new memo.
fsw,
We do exactly this with our complaint system however our database is indexed although this should not be an issue to you. We created a view that is sorted by ID by extracting just the ID from the subject line, order it by ID and then by date descending. Base it on the $ALL folder view so you get both incoming and sent emails.
We then altered the memo form to include an embedded view single category of the new view that sits above the body which shows all other documents linked to the ticket.
This should avoid having to delve to far into the very complex mail template any further. One thing is to make sure you have a copy of the changes you made and a bit of doco re deploying as you can guarantee that one day your template will be completely overwritten in an upgrade and all your good work will be gone.
As the additional field would have to incorporated into all Memo forms in mail templates in your corporation and as these fields do not easily travel via SMTP, you should stick with the ID in the subject.
What you could do is to parse the subject (#Mid, #Right, ...) in the column formula in the view and only display the ID there (like you did with the additional field).
The other option I envision if having a field is required is to have an agent that processes the incoming message(reply) to have it parse out the issue ID from the subject and write it to the field. You could also do that with queryopen or postopen if running an agent is not possible

Disable Word/Sharepoint Integration

I have a requirement to disable the integration between Sharepoint and Word in a project that I am working on. This requirement comes from the request that the user is able to edit the properties of the document but not edit the document itself. The request has also been made to disable the Shared Workspace toolbar that appears when a document is open. The solution must exist on the server as some of the users are external. The users have also requested that they are able to use the Outlook/Sharepoint Integration. Does anyone have any thoughts on how this can be accomplished?
I'm guessing they want to change some document properties, apply those as new field values and print - but not change the original.
Here are some ideas, not sure how useful they could be.
1) apply a password for editing the Word document - It may still allow changing properties & printing.
2) strip out doc the properties and put them in a sharepoint list, with the document itself as an attachement - the document then remains as read-only, but the properties are held separately
3) If your documents are in a list, Allow changes on the list, but demand changes be approved, so users only get to see their own changes, no-one else sees the changes they made. Changes will sit there pending approval. Periodically you can go and reject any changes.

Resources