Hi
Please could someone advise me on how to do the following:
I need to copy document id from one document and copy it to another document using an agent and selecting the documents from the view. Basically, the one id is incorrect and the other is correct, need to copy the id dynamically from one doc to another is this possible?
Many thanks.
Subject: View Query Getting Values Urgent
more detail needed!
-
where does your “incorrect” link come from?
-
are all the docs whose links you want to use already saved, or are they new?
-
what’s your preferred language?
I’ve written agents that make use of link copy functions, at a slightly higher level than grabbing doc UNIDs: you can make an RT field out of a bunch of doc links pretty simply. You may see a lot of stuff in the help about UNIDs and manipulating them, but from my POV these are an accident of history, not a serious technique for modern programming…
Subject: RE: View Query Getting Values Urgent
I have a view with a company document and a person document, the person document is linked to the company document via an id number.When I import new contacts, i have to manually go and connect to the company or the documents are not listed together correctly in a summary view. My pref language is english. The docs are already saved in the database, just with diff id numbers, i am using a id field on the form that stores the value.Any more help would be great. I am running out of time.
Subject: RE: View Query Getting Values Urgent
I think Steve intended to ask your preferred programming language – English is not an option, unfortunately.
As I understand you now, you’re importing documents from some sort of file, and you want to add a field value to the new documents. You want to copy the field value from a document that’s highlighted in the view at the time you do the import.
This is not hard to do, but to do it you must do your import via LotusScript or Java code – the File Import menu function (and the corresponding @Command) don’t let you add your own code.
Use NotesSession.UnprocessedDocuments to get a NotesDocumentCollection of the documents that are selected in the view. If no documents are selected, the highlighted document will be returned. Make sure there’s just one document in the collection. Use GetFirstDocument to retrieve that document, then read the field off and store it in a variable.
As far as the importing process is concerned, you’ll need to figure that out based on the file format and organization of the data.
Another option that might be easier if you are using the built-in import menu item: Have a special view for importing that lists only documents that lack this “ID” field. Provide a view action that lets you select multiple documents and prompts you to choose a company from a view picklist. Fill in the ID field based on this choice. This you should be able to do in macro language.