Solved

LotusScript Dialog box in a view

Posted on 2001-08-10
10
1,324 Views
Last Modified: 2013-12-18
Hi,

I need to select multiple documents, and assign these documents to a person.  Got the script to do the assigning bit (based on unprocessed documents), but I need (and this is all from a view action) to be able to pick a name from the address book from a dialog box, and grab that name and write it to each selected document.

Anyone got any ideas?

thanks,
Joe.
0
Comment
Question by:JoeMunguia
  • 7
  • 3
10 Comments
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6372795
okay try these simple @Function from the action button.

Name_List := @PickList([Name]);
FIELD FIELD_NAME := Name_List;
@All


If you prefer not to select multiple people use the Single parameter.

Name := @PickList([Name]:[Single]);
FIELD FIELD_NAME := Name;
@All

Where FIELD_NAME is the field to which you want to assign the selected name.

Good Luck!
Arun
0
 

Author Comment

by:JoeMunguia
ID: 6372859
Arun,

Thanks, but this has to be done in script, otherwise, the same formula will be run on each document selected e.g.5 out of 12.  The end user doesnt want to have to select 5 docs and select a user 5 times, they want to select a name once and assign the doc to them.  For this reason, I am using unprocesseddocs in script to write to the selected documents only, and now I just need a lotusscript way of prompting the user once for a name to assign to.  Hope this makes sense, I wasnt as clear as I should have been earlier!

thanks,
Joe.
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6373214
okay Joe,

I stumbled upon the same problem that the selection of document are lost when you popup a dialog or view and it affects only the highlighted document.

Today I am able to solve the problem in the following way.

First Create a Folder and name it as Temp_Folder
Create an action button in the view that would run the following @Function,

@Command([Folder];"Temp_Folder" ; 1);
@Environment("List" ; @PickList([Name]:[Single]) );
@PostedCommand([ToolsRunMacro];"(Environment Runner)")

Now, write an agent named "Environment Runner"(run manually from agent list) with lotusScript with the following code in it,

Sub
        Dim ss As New notessession
     Dim db As notesdatabase
     Dim dc As notesdocumentcollection
     Dim doc As notesdocument    
     Dim view As notesview
     
     Set db = ss.CurrentDatabase
     Set view = db.GetView("Temp_Folder")
     
     nam = ss.GetEnvironmentString("List")
     
     Set doc = view.GetFirstDocument
     While Not doc Is Nothing
          doc.one = nam    
          Call doc.Save(True,False)          
          Call doc.RemoveFromFolder("Temp_Folder")
          Call view.Refresh
          Set doc = view.GetFirstDocument
     Wend
     
     Call ss.SetEnvironmentVar("List" , "")
End Sub

If you would like to select multiple people from the address dialogue please let me know there is only one change to be done to the code.

Good Luck!
Arun
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 9

Expert Comment

by:Arunkumar
ID: 6373225
And the change would be as follows,

@Command([Folder];"Temp_Folder" ; 1);
@Environment("List" ; @Implode(@PickList([Name]) ; ",") );
@PostedCommand([ToolsRunMacro];"(Environment Runner)")

Have Fun!
0
 

Author Comment

by:JoeMunguia
ID: 6379336
Arun,

Thanks, this works fine, until two people do the "Allocate" at once.  Any ideas?

thanks,
Joe.
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6379515
What happens when two people do this process a the same time ?

I guess i have a solution for this too.  Wait for sometime.
I will be with you with code !

:-)
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6381359
I went so close but one little thing has to be tuned hang around.
0
 
LVL 9

Accepted Solution

by:
Arunkumar earned 150 total points
ID: 6384623
okay here it comes.

Have the view button to have the code,
@Command([ToolsRunMacro] ; "(AddressDialog)")

Let the addressdialog agent be run "manually from agents list and run once @commands may be used. with the code as follows,

@Environment("List" ; @Implode(@PickList([Name]) ; ",") );
@Command([ToolsRunMacro]; "(SetFields)")

Let the SetFields agent be run "Manually from agents list" and on "Selected Documents" with the code as follows in the initialize event,

Sub Initialize    
     Dim ss As New NotesSession
     Dim db As NotesDatabase
     Dim rdoc As NotesDocument
     Dim Collection As NotesDocumentCollection
     
     nam = ss.GetEnvironmentString("List")
     Set db = ss.CurrentDatabase
     Set Collection = db.UnprocessedDocuments
     
     Call collection.StampAll("one" , nam)
     Call ss.SetEnvironmentVar("List" , "")    
End Sub

Try it.  This worked for me though.

Good Luck!
Arun




0
 

Author Comment

by:JoeMunguia
ID: 6384695
Arun,

Truly Exceptional!!  Thanks for your help.

thanks,
Joe.
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6384737
Anytime Friend.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question