# Optimazing Form Loading

**URL:** <https://forum.servoy.com/t/optimazing-form-loading/12220>\
**Category:** Classic Servoy\
**Created:** [May 22, 2010, 7:28am UTC](https://forum.servoy.com/t/optimazing-form-loading/12220 "2010-05-22T07:28:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sasmithota](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@sasmithota](https://forum.servoy.com/u/sasmithota)\
**Post date:** [May 22, 2010, 7:28am UTC](https://forum.servoy.com/t/optimazing-form-loading/12220/1 "2010-05-22T07:28:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [May 22, 2010, 9:20am UTC](https://forum.servoy.com/t/optimazing-form-loading/12220/2 "2010-05-22T09:20:01Z")

</div>

Hi Sasmit,

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

---

<div class="post-metadata">

**Author:** ![sasmithota](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@sasmithota](https://forum.servoy.com/u/sasmithota)\
**Post date:** [May 22, 2010, 9:37am UTC](https://forum.servoy.com/t/optimazing-form-loading/12220/3 "2010-05-22T09:37:29Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [May 22, 2010, 9:41am UTC](https://forum.servoy.com/t/optimazing-form-loading/12220/4 "2010-05-22T09:41:10Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![sasmithota](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@sasmithota](https://forum.servoy.com/u/sasmithota)\
**Post date:** [May 22, 2010, 10:55am UTC](https://forum.servoy.com/t/optimazing-form-loading/12220/5 "2010-05-22T10:55:09Z")

</div>

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

```auto
	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

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [May 22, 2010, 12:17pm UTC](https://forum.servoy.com/t/optimazing-form-loading/12220/6 "2010-05-22T12:17:44Z")

</div>

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