Solved

LotusScript Dialog box in a view

Posted on 2001-08-10
10
1,298 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now