Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

LotusScript Dialog box in a view

Posted on 2001-08-10
10
Medium Priority
?
1,387 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
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!

 
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

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…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

618 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