Solved

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

Posted on 2006-11-20
17
260 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
Comment Utility
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
Comment Utility
You declared oldenddate as String? Of course, you use Option Explicit/Declare...
0
 

Author Comment

by:cedent
Comment Utility
sg405222 - i'll check.
sjef - ? what do you mean?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 175 total points
Comment Utility
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
Comment Utility
True that would absolutely cause a type mismatch, and slick! that looks better :)
0
 

Author Comment

by:cedent
Comment Utility
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
Comment Utility
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
Comment Utility
I'd be happy to steal them back again some day! ;-))

Happy New Year!
0
 
LVL 8

Expert Comment

by:behenderson
Comment Utility
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
Comment Utility
Thanks all - splitting now.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

8 Experts available now in Live!

Get 1:1 Help Now