Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-11-20
17
Medium Priority
?
268 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 700 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 700 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 700 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

885 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