Solved

I receive 'Type Mismatch' when entering date range on calendar.

Posted on 2006-11-20
17
262 Views
Last Modified: 2013-12-18
I have a calendar that is working fine on another server.  I copied the entire calendar over to a new location with the hope of just modifying the names and implementing for another manager.  I copied it over, tried to enter a date range and received 'Type Mismatch'.  I hit ok.  I save and nothing shows on the calendar.

****ON THE EDCHANGE - FORM THERE IS A STARTDATE:
Sub Exiting(Source As Field)
      Dim ws As New NotesUIWorkspace
      Dim src As NotesUIDocument
      
      Set src= ws.CurrentDocument
      If oldenddate= src.FieldGetText("EndDate") Then
            oldenddate= src.FieldGetText("StartDate")
            Call src.FieldSetText("EndDate", oldenddate)
      Else
            oldenddate= "" 
      End If
End Sub

****THERE IS ALSO AND ENDING DATE:
Sub Exiting(Source As Field)
      
End Sub

****THERE IS ALSO CALDAYS (STATIC TEXT):
@If(StartDate!=NULL;(@Abs(@Integer((EndDate - StartDate) / (86400)))+1);"")

****THIS IS THE FORM THAT I AM ATTEMPTING TO ADD A DATE RANGE TO AND RECEIVE THE TYPE MISMATCH.
****I have very sproadic use of Lotus Notes so please, please be clear with your answers, i'll increase points.


0
Comment
Question by:cedent
  • 6
  • 4
  • 3
  • +1
17 Comments
 
LVL 5

Expert Comment

by:sg405222
ID: 17980088
Q: Are the two servers running the same date format ie dd/mm/yyyy or is one running mm/dd/yyyy it sounds like you have date format issues as you have copied the data across

0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17980286
You declared oldenddate as String? Of course, you use Option Explicit/Declare...
0
 

Author Comment

by:cedent
ID: 17981006
sg405222 - i'll check.
sjef - ? what do you mean?
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17981381
I assume you declared oldenddate somewhere, on a global level?

Did you try running this with the Debugger on? It'll tell you straightaway where the error is.
0
 
LVL 8

Assisted Solution

by:behenderson
behenderson earned 175 total points
ID: 17982979
You may want to try...   @If(StartDate!=NULL;@If(@IsTime(StartDate); @If(@IsTime(EndDate);(@Abs(@Integer((EndDate - StartDate) / (86400)))+1);""); "");"")
to make sure that you have valid dates being evaluated

And sjef bosman means you should have the line below somewhere in your code.

dim oldenddate as String  

He did not see it and he wondered if it was declared in a part of the code that you did not post.   Also sjef is one of several people who really like to put Option Explicit in the Options section of lotusscript code.. It forces you to use better coding style.. Like never having a variable like oldenddate that was not declared anywhere.  Many languages would not let you do something like that.  Option Explicit will cause errors when you save code that does not have variables declared.  Some environments really like using that and some really do not.  If no one else has strong opinions one way or the other I like to use it too.
0
 
LVL 8

Expert Comment

by:behenderson
ID: 17982991
By errors I mean errors at compile time (When you save the code) which is the good time to have errors instead of at runtime.
0
 
LVL 8

Assisted Solution

by:behenderson
behenderson earned 175 total points
ID: 17983141
Also as sjef boseman said..

Did you try running this with the Debugger on? It'll tell you straightaway where the error is.

because none of the code you posted would cause that error.  If you have never used the debugger before you turn it on by going to File   Tools    Debug LotusScript.   You then create a new calendar form and step through the code untill you get to the problem line.  Once you get to the problem line you need to post it.  There are lots and lost of places that the code could be in the form and there could also be subforms on the main form that also have code in them.  the best thing to do is to step through the code using the debugger and figure out which line of code it stops at with the error.
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 175 total points
ID: 17983278
Right, right, and er... wrong! :-)) As far as I can tell, the only source of the error could be the declaration of oldenddate, e.g. if it's declared as Double or NotesDateTime.

By the way, and just for the fun, the triple @If can be reduced to a single one, even without logical-and operators:

@If(StartDate=NULL; "";
    !@IsTime(StartDate); "";
    !@IsTime(EndDate); "";
    @Abs(@Integer((EndDate - StartDate) / 86400))+1)
0
 
LVL 8

Expert Comment

by:behenderson
ID: 17984141
True that would absolutely cause a type mismatch, and slick! that looks better :)
0
 

Author Comment

by:cedent
ID: 18214994
Sorry for not responding, I was out of the office and swampped immediately before leaving.  I completely neglected this. Again apologies.

Running the debugger helped identify where the issue was.  It took me to a completely different area and I commented that code out.  That fixed the problem.  I'd like to split 250 point between behenderson and sjef.  How can i do that.  
0
 
LVL 8

Expert Comment

by:behenderson
ID: 18215810
Thank you cedent.  I am very happy to hear you got your issue fixed and am completely satisfied with sjef getting the points.  I have stolen a point or 2 from him in the past.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 18223458
I'd be happy to steal them back again some day! ;-))

Happy New Year!
0
 
LVL 8

Expert Comment

by:behenderson
ID: 18224026
I'm always happy when I can give the illusion of humility while still getting the points. 8)

Happy New Year to you too!
0
 

Author Comment

by:cedent
ID: 18224316
Thanks all - splitting now.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Querying received e-mails from an agent 7 205
Lotus notes error message 6 98
Domino Smart Upgrade from Release 8.5.3 to 9.0.1 1 960
Save conflict messages on existing documents 15 65
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

786 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