Lotus Domino 7 isnewdoc or is newnote help needed!

105 pts.
Tags:
Lotus
Lotus Domino 7
Lotus Domino development
I am working on setting a default value for a feild in a view I have completed the web side of things but I was instructed to go into the postopen form and write something like if isnewdoc then default the daysopen field to a value of "1". this is what i tried and it didn't work any advice on how to do this.

 If uidoc.IsNewdoc Then Set doc = uidoc.Document Call doc.ReplaceItemValue("daysopen","1")

Call doc.Save(True, False) Set doc = view.GetNextDocument(doc)

End If

 How I could use postopen and put code in there so that "daysopen" would get a default value of 1. I originally did an if statement with @today in the field but that made it run far to slow. So I wrote an agent and now it runs faster it just doesn’t get the first day "1" because the agent only runs once a day so until it runs it is blank. I need a code that would set the default in the client postopen that so it doesn't slow it down. Any Ideas?

Please help me fix this.

PS. I am using a form for this and need to write code into the postopen form to get the default vavle

Answer Wiki

Thanks. We'll let you know when a new response is added.

In the field, find the default value property. Set it to 1. Or “1″, depending on whether you want a numeric or text value. Don’t use a form queryopen or any other lotusscript event. the field itself is programmable.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • BruceWayne
    Brooklynegg is right, set the default value to the field... But if you want absolutely set it in postopen, try :
    if source.IsNewDoc then
        if source.editMode then
            call source.FieldSetText( "daysopen", "1")
        end if
    end if
    
    4,110 pointsBadges:
    report
  • Brooklynegg
    BruceWayne: the poster, AMcAuley3, says he has "...completed the web side of things...". It sounds like he is developing something for a browser, not the Notes client. Would the lotusscript postopen event evaluate from the web? I don't remember ever using a postopen for a web app. I don't have time to test it now. If he really wants to use script, I think he could write an agent, then call it in the webqueryopen. What do you think?
    3,845 pointsBadges:
    report
  • BruceWayne
    Mmmm :- You're right again Brooklynegg ! Postopen doesn't trigger in web. But webqueryopen will do the trick. Sorry, I did not see the "Web Side Of Things" ...
    4,110 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following