[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Creating Document executing @command - alternative

Posted on 2006-04-13
12
Medium Priority
?
236 Views
Last Modified: 2013-12-18
I need some help. I have a button on a document that executes some @commands. I want these commands to execute automatically when creating a new document. I know (from experience) that @commands and other ui functions are not supported in that context. Is there an alternative to automatically executing @commands at document creation?
0
Comment
Question by:schmad01
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 16449438
Well, you could put the commands in the Queryopen or querysave of the Form.

It depends on the commands.

It would be best to copy and paste them here for examination.

I hope this helps !
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16450816
Depending on the command and what you're trying to do,  you can put them into the post open (I don't know about the query open, I think you'd have to wait until the document was available in the UI, and committed to edit more or not)

You can try a computed field either at the top or bottom of the form with the commands either in the computation, but the last line being the field name, or you can possibly put them in the validation event of a field at the bottom of the form.

Either will need some debugging checks, because if they don't run right, then the form won't open at all.  You also will have to check for isdocbeingedit, or isdocbeingsaved... etc.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16451820
And don't be too cryptic, but let us have a look at your @Commands. A vague question will only lead to vague answers...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:schmad01
ID: 16471820
Just trying to start a dialogbox: @DialogBox("SelectionPop"; [AutoHorzFit] : [AutoVertFit]);

in a computed when composed field. I understand why dialogbox won't work - because there is no saved document to act on. Is there a script alternative where the pop up uses radio buttons to select from or would I have to use something like an @Prompt([OkCancelList])?
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16473027
fastest way is to open designer help and look at the examples for:

@DialogBox, @Prompt, and then the workspace.dialogbox and workspace.prompt.

I personally wouldn't put a dialog box command in a computed when composed field.   You can put it under a button and then hide the button when you no longer need it.

Or you can put it in a computed field, as long as you're setting values in other fields and testing for when it should or should not appear.

Again, repeating what sjef says:  don't be too cryptic.. what is it that you're trying to do?

0
 

Author Comment

by:schmad01
ID: 16497593
I'm just trying to start a form and rather than have the user click a button on the form to bring up the dialogbox, I would rather it come up automatically.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16497689
And it must be Formula language? Can't you use LotusScript from the QueryOpen event? I suppose it will work.
0
 

Author Comment

by:schmad01
ID: 16497844
No, it doesn't have to be formula. I just don't know how to write script.
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 500 total points
ID: 16498096
Just some quick code then, in LotusScript:
- open the form
- put this code in the Global section of the form
    Dim dbdoc As NotesDocument ' global, so it can be used later on as well
- put this code in the QueryOpen-event:
    Dim ws As New NotesUIWorkspace
    Dim ns As New NotesSession
    Dim db As NotesDatabase

    If Not IsNewDoc Then Exit Sub
    Set db= ns.CurrentDatabase
    Set dbdoc= New NotesDocument(db)
    Continue= ws.DialogBox("SelectionPop", True, True, ,,,, "Title", dbdoc)
    If Not Continue Then
        Set dbdoc= Nothing
    End If
- put this code in the PostOpen-event
    Dim doc As NotesDocument

    Set doc= Source.Document
    If Not(dbdoc Is Nothing) Then
            doc.SomeField= dbdoc.SomeField(0) ' if there are more fields, code should be added to copy them
            Set dbdoc= Nothing
    End If
0
 

Author Comment

by:schmad01
ID: 16534968
Will try, sjef.
0
 

Author Comment

by:schmad01
ID: 16698565
Sorry, almost forgot about this question. Anyway the solution helped me out immensely. Thanks.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

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…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

872 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