?
Solved

Document Created with agent doesn't have form?

Posted on 2003-03-26
20
Medium Priority
?
235 Views
Last Modified: 2013-12-18
Hi All,

this is a strange thing I have been experiencing:
I create a document

[...]
     Set db=session.currentdatabase
     Dim doc As New NotesDocument( db )

and assign a form to it:

     doc.form="someform"

then I set some values and save the document.
I have a view to show the documents of form "someform", but the newly created documents doesn't show up. I go to a view showing all document, open the new document, edit a field (for example add a blank) and save it. And magically then it shows up in the view showing "someform"...
It is not a problem of refreshing the view, I can hit F9 a hundret times and the doc doesn't show up...

Can anyone explain this to me?? I actually don't consider me a Notes-beginner, but this is a mistery to me...

Thanks a lot in advance,
cashman

0
Comment
Question by:cashman
[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
  • 6
  • 5
  • 4
  • +3
20 Comments
 
LVL 13

Expert Comment

by:CRAK
ID: 8209713
Are you displaying a field created by the agent in the all someform-view while showing e.g. [documentno. in view] (not a specific field) in the all documents view?

A field (NotesItem) has a property "IsSummary". It determines wether or not a field can be displayed in a view.

What could be happening is that the document is shown as an empty line since the created fields don't show yet.
When editing it (front-end) those properties are recalculated and set to True.
0
 
LVL 4

Expert Comment

by:hshevitz
ID: 8209914
Hmmm, tried to duplicate this with a simple test script and it worked OK for me. What else is in your code to create the document?

Test Script:

     Dim session As NotesSession
     Dim db As NotesDatabase
     
     Set session = New NotesSession
     Set db = session.CurrentDatabase
     
     Dim doc As New NotesDocument(db)
     
     doc.Form = "someform"
     doc.Field1 = "Field 1"
     doc.Field2 = "Field 2"
     doc.Field3 = "Field 3"
     
     Call doc.Save(True, False)

View has selection formula of SELECT Form = "someform"

This works ok
0
 
LVL 5

Expert Comment

by:snocross
ID: 8210001
Ok so are you basicly saying the document DOES appear in your ALL DOCUMENTS view but it DOES NOT appear in a different customized view until the document is resaved?  If this is the case then please post your view selection formula for the different view.

-Snocross
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: 8210150
   Dim session As NotesSession
    Dim db As NotesDatabase
    Dim item as notesitem    

    Set session = New NotesSession
    Set db = session.CurrentDatabase
   
    Dim doc As New NotesDocument(db)
    Set item = New NotesItem(doc,"Form" , "SomeForm")
    item.IsSummary = True
    doc.Field1 = "Field 1"
    doc.Field2 = "Field 2"
    doc.Field3 = "Field 3"
   
    Call doc.Save(True, False)

Try this instead of doc.Form = "someform"

Rgds,
Arun.
PS: Please increase the points since i have not earned some in quite a while now and no one is allowing me to steal their points too... :-)
0
 
LVL 4

Expert Comment

by:hshevitz
ID: 8210230


It works with

  doc.form = "someform"

and doesn't work with (same as with the cashman description)

  Set item = New NotesItem(doc,"Form" , "SomeForm")

I have duplicated the problem using the "Set item..." statement.
0
 

Author Comment

by:cashman
ID: 8210571
Hi All

Thanks a lot for your comments.

What I found out now:
First:
The Script works well if what is set with

doc.form="xy"

is the same as the

SELECT form = "xy"

in the viewselection

When I use aliases it does not work :(

This is also, why hshevitz's Set Item doesn't work while the doc.form works...

Second:
Running a lotusscript-agent with target "all documents in view" doesn't work if there a no doc in the view :)) Specifying "None" works a lot better...


Well now...the interesting question for me is: Why does it not work when I enter an alias? Did I misunderstand aliases completely?


regards,
cashman

0
 

Author Comment

by:cashman
ID: 8210594
maybe I should add a better example:

if the viewselection is

SELECT form = "someform"

the doc.form= must be doc.form="someform" and cannot be "otherform" even if this is an alias.


regards,
cashman



0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 8210603
Well...now...

Alais is the only value that is stored in the document.

And when a document opens with the form at its base then it displays the name and not the alias.  This is determined by the form with which the document is opened.

The view does not have anything to do with the form as such. It displays only the documents. And the documents contain only alais name.

Hope this clears things a lot better right ?

-Arun.
0
 

Author Comment

by:cashman
ID: 8210752
maybe I should add a better example:

if the viewselection is

SELECT form = "someform"

the doc.form= must be doc.form="someform" and cannot be "otherform" even if this is an alias.


regards,
cashman



0
 
LVL 4

Expert Comment

by:hshevitz
ID: 8210825
In code, always set the form name to the "real" form name...not the alias. If the form name is set as

Alias Form | frmRealForm

You will always use frmRealForm in your code.

doc.Form = "frmRealForm"

Hope this gives you a clear picture.

HS
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 8210836
uh Oh...

Always set the alias name.  The views need not be altered.

-Arun.
0
 
LVL 9

Accepted Solution

by:
Arunkumar earned 300 total points
ID: 8210850
This is because its the alias name that will get stored in the document.  And it will be the one used for view selections.

Interestingly the actual form name can be displayed if you open the document with a form containing the form field.

-Arun.
0
 

Author Comment

by:cashman
ID: 8210918
Hi All,

*completely confused*
Did I get that correctly that I can't use

"someform"

and

"someformalias"

equally in my code? I always thought that I can use the as if they where the same...

One more question: If the "real" formname is not stored in the document, how can it be that with my original problem I could edit the newly created document and then it was displayed in the view?


thanks and regards,
cashman
0
 
LVL 4

Expert Comment

by:hshevitz
ID: 8210924
Oops, got my terms reversed:

Leftmost name is the original name
Rightmost name is the alias name

Let me change this around...

In code, always set the form name to the "alias" form name...not the original name. If the form name is set as

Original Form | frmAliasForm

You will always use frmAliasForm in your code.

doc.Form = "frmAliasForm"

Your View selection formula should be

SELECT Form = "frmAliasForm"

Now, I'm sure I have confused everyone! Sorry about that! :-(

HS
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 8210973
This is a known problem in R5.

The workaround as suggested by Lotus is to repeat the alias name once again in the form name property.

SOURCE: http://www-1.ibm.com/support/docview.wss?rs=475&context=SSKTWP&q=1102039&uid=swg21102039&loc=en_US&cs=utf-8&lang=en

~Hemanth
0
 

Author Comment

by:cashman
ID: 8211016
@Hemanth : Not sure which problem you mean by "this"...(btw: I am using Notes 6)

0
 
LVL 13

Expert Comment

by:CRAK
ID: 8211321
Can you please verify the new documents propertybox in the all documents view? Check the FORM-fields value and any field flags mentioned.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 8211344
Maybe it was not fixed in R6 too.

Repeat the alias and see if helps.

In your case it would be

Form Name|someform|someform
0
 

Author Comment

by:cashman
ID: 8211513
Hi All,

as things got rather messy I'd like to sumarize here:
Problem:
I create a doc from an gent and set the doc.form property. The doc doesn't show in my view. (to be very short)

Solution:
Work only with aliases in the code (I did set doc.form to the name, not alias).

Other stuff:
I am confused about how aliases work. I always thought I can use one or the other, no difference. In fact only the alias of the form is stored in the documents created from them. When setting the from-field from code it is my duty to make sure that the alias is there and not the name of the form.
If you use the formname you can see the document only in a view showing all docs, editing such a document will change (!) the value of the "form" field to the alias of the form the doc was created on. This is why everything works if a "problematic document" is resaved.
I think that by now I understood the alias-thing (though I still think it is not really logical)

Next problem: How do I decide who gets the points? (Serious question as this is my first Post here and noone gave me the_ answer


regards,
cashman



PS: @CRAK: To have your question answered: the fields are OK, I "just" messed up things with wrong use of aliases
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 8212142
to who ever you want to award points just accept comment as answer link right to the name.  And grade it accordingly.

If you wish not to give anyone points post a link to this question to the community support and they will delete it for you !

-Arun.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

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