Use 2 Date records (virtual table).
Do a setrange on both with data from each user, if the both return NOT ISEMPTY you have your error.
TestUserEntry.RESET; TestUserEntry.SETFILTER("Entry No.",'<>%1',"Entry No."); TestUserEntry.SETRANGE(UserID,UserID); TestUserEntry.SETFILTER("Starting Date",'<=%1',"Starting Date"); TestUserEntry.SETFILTER("Ending Date",'>=%1',"Starting Date"); IF TestUserEntry.FINDFIRST THEN ERROR('Starting Date not correct. Existing Entry %1',TestUserEntry."Entry No."); TestUserEntry.SETFILTER("Starting Date",'>=%1',"Starting Date"); TestUserEntry.SETFILTER("Ending Date",'<=%1',"Starting Date"); IF TestUserEntry.FINDFIRST THEN ERROR('Starting Date not correct. Existing Entry %1',TestUserEntry."Entry No."); TestUserEntry.SETFILTER("Starting Date",'>=%1',"Ending Date"); TestUserEntry.SETFILTER("Ending Date",'<=%1',"Ending Date"); IF TestUserEntry.FINDFIRST THEN ERROR('Ending Date not correct. Existing Entry %1',TestUserEntry."Entry No."); TestUserEntry.SETFILTER("Starting Date",'<=%1',"Ending Date"); TestUserEntry.SETFILTER("Ending Date",'>=%1',"Ending Date"); IF TestUserEntry.FINDFIRST THEN ERROR('Ending Date not correct. Existing Entry %1',TestUserEntry."Entry No.");
Answers
Do a setrange on both with data from each user, if the both return NOT ISEMPTY you have your error.
Please give us the code. I don't get this sorry.
Those things can drive me crazy. But I like such competitions.
I have a quite complicated way. BUT there MUST be an easier way.
thinknavblog.wordpress.com
thinknavblog.wordpress.com