Solved

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

Posted on 2006-11-20
17
261 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now