Appointments Module in Servoy - mfModuleAppointments

jasantana:

michele:
Someone has tested to use this module in an application based on the servoy navigation framework ?
I receive an error (“Cannot rander the Calendar. Please Restart the application!” when the main form is opened and i can’t see the months panel on the left…

I think the solution for your problem is some posts ago. It might be the SQL to retrieve the data and the dates format

I think this is not the same problem. I have corrected the rows with the problem explained some posts ago. In fact if i run the module in standalone mode it is all ok. The problem is only when i attempt ro run the module into my application that works with the servoy navigation framework…i don’t know which is the problem…i am not an expert in Servoy…i use it since the beginning of this year and i come from Visual Foxpro not from Java…i have seen that the error message appears every time an error is found in the “try” structure…the message is in the “catch” part… and the result is that the months in the left side of the form are not present after the error…

I have commented the try/catch structure and i have found that the program find this error

"TypeError: Cannot call method “getFullYear” of null "

on this statement

var navEndDate = new Date(navCalStartDate.getFullYear(),
navCalStartDate.getMonth() + 3,
navCalStartDate.getDate());

what can i try ?

So the variable navCalStartDate holds null. Where does is get set ?

Thank you !

The previous error was generated by another try/catch structure taht goes in error…commented also this try/catch and the first error seems to be this:

Exception Object: org.mozilla.javascript.EvaluatorException: Can’t find method com.servoy.j2db.scripting.solutionmodel.JSForm.js_newLabel(string,number,number,null,number). (K:\servoy_workspace\mfModuleAppointments\forms\mfcal_main.js#187)
MSG: Can’t find method com.servoy.j2db.scripting.solutionmodel.JSForm.js_newLabel(string,number,number,null,number). (K:\servoy_workspace\mfModuleAppointments\forms\mfcal_main.js#187)
Can’t find method com.servoy.j2db.scripting.solutionmodel.JSForm.js_newLabel(string,number,number,null,number). (K:\servoy_workspace\mfModuleAppointments\forms\mfcal_main.js#187)

with(frmObj.newLabel(‘’, colCnt * cellWidth , 0, cellWidth, (cellNormalHeight * 21) + (headerCellHeight * 3)))

how is there a ‘null’ in this:

string,number,number,null,number

that should also be a number.

The problem is that when i use this module in my application and i run it, the form when is loaded is lined to the requested table, but doesn’t see the record stored in it…so the null values returned…and all the problems in the creation of the form…if i set the values, normally read from the table, manually all seems to run without problem…but if i attempt to read data from the parameters tables no records are displayed…i don’t know why…

My application works with another server name that is different from the original (schedule). All ther tables are in my server and i have checked that all entries in files in workspace haven’t references to old server name (schedule) and have only references to my server’s name (approdo).
The problem is still present. When i open the form the record in the tbl_preference table is not read…and if i enter the settings form i can’t see the data stored in the table. I can save new appointments and search all old appointments…In the settings form i can’t see the appointment’s type table, but if i insert a new appointment i can see the valuelist of the appointment’s type…

I don’t know what verify anymore…

The problem has been resolved. The appointments module can runs in standalone mode or as module in another application. When starts in standalone there is a method in onShow that execute some statements and between these there is a loadallrecords() of the main form. If the module is inserted in another application the onShow is not executed…if i put the loadallrecords() before calling the main form it is all ok.

The only problem is still present is that when i call the main form from another application and i attempt to call the full method present in onshow of the module it runs correct only the first time, while the next it shows an error message…

xception Object: java.lang.RuntimeException: Couldn’t start the scheduler! Unable to store Job with name: ‘showAlert’ and group: ‘13DDEB9A-2C32-469E-970B-0F0F5E9149A6’, because one already exists with this identification.

@pradiptab

Good afternoon from Gran Canaria. First I want to thank you for this contribution, it is a very good one.

I have been trying to make it work as a module in one solution and I do not know how to get something. What I need is to share my solution navigator and to do that I created a new form in my solution that extends mfcal_main and set the navigator to my own, but it does not work as expected and do not know why. Have you tried to get that?

Thanks in advance

I have resolved all the problem i encountered while inserting mfModuleAppointments as module of my application.
The method i called before opening the form with the calendarhad reports an error when trying to initialize the scheduler twice…i inserted a control that opens the scheduler only if it is not already activated…

michele:
I have resolved all the problem i encountered while inserting mfModuleAppointments as module of my application.
The method i called before opening the form with the calendarhad reports an error when trying to initialize the scheduler twice…i inserted a control that opens the scheduler only if it is not already activated…

Are you using the calendar form with a navigator of your own? Have you tried to create a form in another solution and extend the mfcal_main?

If so, could you please tell me how did you get it?

Thanks.

Browsing a bit through this modules, but this is a pretty nice job! Way to go!
I’dd say put this on ServoyForge :)

Hi,

I have implemented this as a module in my solution, but am using it to concatenate the diary from my solution with any other appointments, so am just pushing appointments into your tables etc.

My main problem, and this may be due to the sheer number of appointments I have in one day appears to be in the routine - arrangeAppointments(currentDate)

I keep getting the error related to more than 50

if (level > 50 && plugins.dialogs)
			{
				//plugins.dialogs.showErrorDialog('Error', 
				//	'Another date selected before processing. Please Click on the new date!','OK');
				break;
			}

When i have lots of appointments in one day this error keeps coming up.

Am i right in thinking that this is looking at permutations of multiple appointments at the same time.

is my solution to remove the warning dialogue going to mean that appointments are left out of the view? or is this the best solution to my problem?

What is causing this, i assume it may be having 60 appointments in one day, which might kill your comparison script?

David

David, did you find a solution to this?

I am looking at similarly using the mfModuleAppointments as a module simply to display a variety of date related objects (scheduled tasks, works, bookings etc). As most of these are shared by multiple users (and therefore linking any one event to a single id does not work) I am planning to create a new set of records for the current user in the schedule tables immediately prior to showing the calendar. Is this what you do?

I have already run into the issue you highlight when there are many events on one day. Any tips you (or anyone else!) have on the best approach would be really useful.

Hi all,
I am looking at this module as a solution to allow me to display calendar appointments on an iPad that were created in Smart client with the IT2Be Calendar Bean (which isn’t web compatible).
I am using a table, called ‘events’ that holds all the appt info, like start & end date time, description etc.
Am I going to have to copy all of this over into a table in this module, or can I point this module to my table(s)?
Thanks!
Rafi

Rafi,

I must say I cheated and copied the appointments across, but i did that so that i could also have other no solution based appointments added using the mfModule. i.e It gave solution based dates, which became duplicated and also “external appointments” to my solution, so a combo really.

I also thought that it was easier to create a couple of duplication functions within my main solution than try to pick out how to point the appointments table to my solution, especially given that it has the two table structure to allow for repeats.

Have offered to pay mindfire to create some specific solution model views for iphone, but at present P is too busy on other projects.

David

Thanks David,
when I get a chance to play with this, I’ll try and decide which way to go (it’s not at the top of the list currently)…
Rafi

Does anyone know how to get multi-day appointments in month view to span multiple days - this works fine in week view but in month view only the first date shows

Bug in mfModuleAppointments

I think i have found a bug in the query for appointments:

As it stand if an appointment fulfils the second AND criteria in the query then it appears to forget the SaaS bit! You will see I have added ‘AND m.user_idx = ?’ into the query and get the user_id again in the array below.
This seems to restore the saas element so other cannot see my appointments. I think the bug might be a little spurious as the reason i go an appointment a week long was another bug!!!.
This may need changing in other views as well. week and month perhaps.

David

 sqlQuery = 'SELECT ' +
	 						'm.appt_master_idx,' +
	 						'a.appointment_idx, ' +
	 						't.appt_color_code, ' +
	 						'm.appt_priority, ' +
	 						'a.appt_title, ' +
	 						'a.appt_description, ' +
	 						'a.appt_location, ' +
	 						'a.appt_start_datetime, ' +
	 						'a.appt_end_datetime, ' +
	 						'm.user_idx ' +
					'FROM ' +
							'mfcal_tbl_appt_masters m ' +
						'INNER JOIN ' +
							'mfcal_tbl_appointments a ' +
						'ON ' +
							'm.appt_master_idx = a.appt_master_idx ' +
						'INNER JOIN ' +
							'mfcal_tbl_appt_types t ' +
						'ON ' + 
							'm.appt_type_idx = t.appt_type_idx ' +
					'WHERE ' +
							'm.user_idx = ? ' +
						'AND ' +
							'a.appt_start_datetime >= ? ' +
						'AND ' +
							'a.appt_start_datetime < ? ' +
						' OR (a.appt_start_datetime < ? AND a.appt_end_datetime > ? AND m.user_idx = ?) ' +
					'ORDER BY ' +
							'a.appt_start_datetime ASC;';
		
		//find the data source
		datasource = controller.getDataSource().split('/')[1];
						
		//fetch data as sataset
		apptDataset = databaseManager.getDataSetByQuery(datasource, 
			sqlQuery, [globals.mfcal_g_getUserIDx(), 
			utils.dateFormat(dayViewStartDate, 'yyyy-MM-dd HH:mm:ss'),
			utils.dateFormat(dayViewEndDate, 'yyyy-MM-dd HH:mm:ss'),
			utils.dateFormat(dayViewStartDate, 'yyyy-MM-dd HH:mm:ss'),
			utils.dateFormat(dayViewStartDate, 'yyyy-MM-dd HH:mm:ss'),globals.mfcal_g_getUserIDx()], 10000);
		application.output(apptDataset)
		application.output('Userid: '+globals.mfcal_g_getUserIDx())