Home > Ask the Domino Experts > Domino Development Questions & Answers > Insert calendar/reminder object using Java client and Domino Java API
Ask The Domino Expert: Questions & Answers
EMAIL THIS

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

Andre Guirard EXPERT RESPONSE FROM: Andre Guirard

Pose a Question
Other Domino Categories
Meet all Domino Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 11 March 2005
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?



Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Domino Development
Can I create and copy Microsoft Excel spreadsheets with LotusScript?
'Illegal circular use: Audit Trail' error when opening Lotus Notes docs
How to make computed fields recalculate
Sending and logging faxes from Lotus Notes and Domino
Accessing documents in a Lotus Notes database
Adding an action to the Lotus Notes right-click menu
Writing temporary text files that email as attachments
Trapping the on-click event of a radio button
Copying a form object using LotusScript
Connecting to a remote DB2 server with LEI

Java for Lotus Notes Domino
Top 10 Lotus Notes/Domino coding and development tips of 2008
Java code inserts data from Notes documents into a SQL table
Java code shortens strings in a SQL table
How to execute a stored procedure in Lotus Notes Domino using Java
Top 10 Lotus Notes Domino programming and development tips of 2007
How to return an HTML representation of a Lotus Notes rich-text field
Shrink Lotus Notes databases with many attachments
Converting Lotus Notes Domino Web pages to PDF files with a Java agent
Developing Eclipse plug-ins for Lotus Notes and Domino -- 7 tips in 7 minutes
A bevy of Notes/Domino development tips

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


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.




Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Lotus Notes Domino on Blackberry and mobile devices
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts