?
Solved

LotusScript Dialog box in a view

Posted on 2001-08-10
10
Medium Priority
?
1,363 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 600 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

777 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