Q
Problem solve Get help with specific problems with your technologies, process and projects.

Insert calendar/reminder object using Java client and Domino Java API

SearchDomino.com expert Andre Guirard offers an option to a developer trying to insert a calendar/reminder object using a Java client and the Domino Java API.

I'm a Java developer. I tried to insert a calendar/reminder object using a Java client and the Domino Java API.

This is my code:

... 
doc = db.createDocument(); 
doc.appendItemValue 
        ("Form","Appointment"); 
doc.appendItemValue   
        ("AppointmentType","4") ; 
doc.appendItemValue   
        ("Principal",remoteuser) ; 
doc.appendItemValue 
        ("Chair",remoteuser) ; 
doc.appendItemValue 
        ("From",this.remoteuser) ; 
doc.appendItemValue 
 ("Subject","java client reminder") ; 
doc.appendItemValue 
 ("Location","paris") ; 
doc.appendItemValue 
 ("Body","body body") ; 
Session stmp = db.getParent(); 
DateTime currTime = 
 stmp.createDateTime(Utility.getNow()); 
currTime.setNow(); 
currTime.adjustHour(1, true); 
doc.appendItemValue 
    ("CalendarDateTime",currTime) ; 
doc.appendItemValue 
    ("StartDate",currTime) ; 
doc.appendItemValue 
    ("StartTime",currTime) ; 
doc.appendItemValue 
    ("StartDateTime",currTime) ; 
currTime.adjustHour(1, true); 
doc.appendItemValue 
    ("$NoPurge",currTime) ; 

doc.appendItemValue 
 ("LocalTimeZone","Z=-1$DO=1$DL=3 -1 
1 10 -1 1$ZN=Western/Central Europe") ; 
doc.appendItemValue 
 ("StartTimeZone","Z=-1$DO=1$DL=3 -1 
1 10 -1 1$ZN=Western/Central Europe") ; 
doc.appendItemValue 
 ("EndTimeZone","Z=-1$DO=1$DL=3 -1 
1 10 -1 1$ZN=Western/Central Europe") ; 

doc.appendItemValue 
 ("_ViewIcon",new Integer(10)) ; 
doc.appendItemValue 
 ("SequenceNum",new Integer(1)) ; 
doc.appendItemValue 
 ("ExcludeFromView","D") ; 
doc.appendItemValue 
 ("OrgTable","C0") ; 
doc.appendItemValue 
 ("OrgConfidential","0") ; 

doc.computeWithForm(true, true); 
doc.save(true, true, true); 

.... 
------------- 

I have the following error:

The validation fails (computeWithForm throws an error).

If I save the document without validation, I can see it using the "Domino Web access console" but I can't modify or delete it from calendar view. The only way to delete the document is in "All Document" view. Can you help me?

What you are trying to do is complex. The calendar document has a great many fields on it and you must create your fields with the right datatype and appropriate values. ComputeWithForm is probably not going to be enough to fix any mistakes you have made and supply any missing data, because much of the code that manipulates values in a calendar entry is written in LotusScript events, which do not trigger on ComputeWithForm. Plus, if you have failed to supply a required field, ComputeWithForm cannot supply it for you.

Try this: Create an appointment manually like the one you want to create automatically, then use this tool to automatically generate the LotusScript code that would recreate it. I don't have a Java version of this tool, but this will at least show you what fields you need to set and what data types to set them to.

Do you have comments on this Ask the Expert question and response? Let us know.

This was last published in March 2005

Dig Deeper on Java for Lotus Notes Domino

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

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

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchExchange

SearchContentManagement

Close