Optimazing Form Loading

Hi all,

I have added a rowBgColor calculation in a form and in the rowBgColor calculation, I am returning the color code according to the value of status field(from the table based on that form). Servoy, at the first time, loading 200 records and only for those 200 records, the form is taking around 4-5 minutes to get loaded. I have also created an index on the status field on that table. but, still the same scenario happens. Is there anything that I should look into?? Please, advise.

Thanks,
Sasmit

Hi Sasmit,

Do you perhaps use a (stored) calculation on this status field as well ?

ROCLASI:
Hi Sasmit,

Do you perhaps use a (stored) calculation on this status field as well ?

No, Status is an ordinary field of type Integer. It is not a calculated field. and also, there is not any stored calculation basing upon this status field.

Thanks,
Sasmit

HI Sasmit,

So when you take that rowBgColor calc of the form what are the load times then ?
Also can you show us your rowBgColor calc?

ROCLASI:
So when you take that rowBgColor calc of the form what are the load times then ?
Also can you show us your rowBgColor calc?

Hi Robert,

It is taking around 4-5 Minutes.

Yes, sure. Code is very simple and straight forward.

	var curRecord = arguments[5];
	var curRecStatus = curRecord.status;
	
	if(curRecStatus == globals.STATUS_NEW) {
		return globals.REC_DISP_COLOR_STATUS_NEW;
	} else if(curRecStatus == globals.STATUS_ACTIVE) {
		return globals.REC_DISP_COLOR_STATUS_ACTIVE;
	} else if(curRecStatus == globals.STATUS_ON_HOLD) {
		return globals.REC_DISP_COLOR_STATUS_ON_HOLD;
	} else if(curRecStatus == globals.STATUS_CANCELED) {
		return globals.REC_DISP_COLOR_STATUS_CANCELED;
	}
        
	return globals.REC_DISP_COLOR_NON_STATUS;

Thanks,
Sasmit

sasmithota:

ROCLASI:
So when you take that rowBgColor calc of the form what are the load times then ?
Also can you show us your rowBgColor calc?

Hi Robert,

It is taking around 4-5 Minutes.

So with the rowBgCalc it takes 4-5 minutes to load and without it does also 4-5 minutes to load?
Seems to me that the rowBgCalc is not your problem then.