We regular have problems like the ones below.
It happens about 3 times a week with different users.
B.t.w. the code that triggers the problem is executed hundreds of times a day for each user without problems
It looks like sometimes :
- a foundset exists, has records but there is no selected record (example 1)
- the onDataChange event does have an elementname (field) but no formname ( example 2)
As I understood from Sanneke and Johan a foundset always has a selected record, unless
it is empty.
Has anyone seen simular problems ??
I'll also create a case for this.
B.t.w. : I've put the line number on which the error is reported as comment at the end of the line !!
example 1 :
- Code: Select all
Error 1:
========
ssa noSelectedrec= JSEvent(type = dataChange, source = com.servoy.j2db.smart.scripting.TwoNativeJavaObject@19724b7, formName = bvko_navInkorderspecregelsPrim_lst, elementName = inkorsrgl_prodart_nr, timestamp = Mon Nov 15 14:25:42 CET 2010,modifiers = 0,x =0,y = 0,data = null)
IBISMain INFO 2010-11-15 14:25:42.735: ssa fs_size= db:/berp2/inkorderspecregels
IBISMain INFO 2010-11-15 14:25:42.735: ssa fs_size= 4
IBISMain INFO 2010-11-15 14:25:42.735: ssa fs_count= 4
IBISMain ERROR 2010-11-15 14:25:42.767: In error Trap
IBISMain ERROR 2010-11-15 14:25:42.767: Exception Object: org.mozilla.javascript.EcmaError: TypeError: Cannot read property "bcom_inkorderspecregels_to_verkorderregels$verkor_id" from (doSetSignalArt#587)
IBISMain ERROR 2010-11-15 14:25:42.767: MSG: TypeError: Cannot read property "bcom_inkorderspecregels_to_verkorderregels$verkor_id" from (doSetSignalArt#587)
IBISMain ERROR 2010-11-15 14:25:45.857: Other Error: org.mozilla.javascript.EcmaError: TypeError: Cannot read property "bcom_inkorderspecregels_to_verkorderregels$verkor_id" from (doSetSignalArt#587)
code 1:
=======
function doSetSignalArt(_old, _new, _event, _inpForm)
{
var _foundset;
if(_event && !_event.getFormName()){
plugins.Log.info('ssa noEventForm= ' + _event)
}
else if(!_event && !_inpForm) {
plugins.Log.info('ssa noEventnoForm= ')
}
//get foundset
if(_event)
_foundset = forms[_event.getFormName()].foundset;
else
_foundset = forms[_inpForm].foundset;
if(!_foundset.getSelectedRecord()){
plugins.Log.info('ssa noSelectedrec= ' + _event)
plugins.Log.info('ssa fs_size= ' + _foundset.getDataSource())
plugins.Log.info('ssa fs_size= ' + _foundset.getSize())
plugins.Log.info('ssa fs_count= ' + databaseManager.getFoundSetCount(_foundset))
}
if(databaseManager.hasRecords(_foundset.getSelectedRecord().bcom_inkorderspecregels_to_verkorderregels$verkor_id)) //line 587
{
_foundset.getSelectedRecord().bcom_inkorderspecregels_to_verkorderregels$verkor_id.verkor_spec_edited = '*';
}
}
example 2
- Code: Select all
error 2:
========
ssa noEventForm= JSEvent(type = dataChange, source = com.servoy.j2db.smart.scripting.TwoNativeJavaObject@136eff6, formName = null, elementName = inkospcrgl_vk_prijs, timestamp = Wed Nov 17 11:06:05 CET 2010,modifiers = 0,x =0,y = 0,data = null)
IBISMain ERROR 2010-11-17 11:06:05.186: In error Trap
IBISMain ERROR 2010-11-17 11:06:05.186: Exception Object: org.mozilla.javascript.EcmaError: TypeError: Cannot read property "foundset" from undefined (doSetSignalArt#382)
IBISMain ERROR 2010-11-17 11:06:05.186: MSG: TypeError: Cannot read property "foundset" from undefined (doSetSignalArt#382)
IBISMain ERROR 2010-11-17 11:08:34.127: Other Error: org.mozilla.javascript.EcmaError: TypeError: Cannot read property "foundset" from undefined (doSetSignalArt#382)
code 2 :
========
function doSetSignalArt(_old, _new, _event, _inpForm)
{
var _foundset;
if(_event && !_event.getFormName()){
plugins.Log.info('ssa noEventForm= ' + _event)
}
else if(!_event && !_inpForm) {
plugins.Log.info('ssa noEventnoForm= ')
}
//get foundset
if(_event)
_foundset = forms[_event.getFormName()].foundset; //line 382
else
_foundset = forms[_inpForm].foundset;
if(!_foundset.getSelectedRecord()){
plugins.Log.info('ssa noSelectedrec= ' + _event)
plugins.Log.info('ssa fs_size= ' + _foundset.getDataSource())
plugins.Log.info('ssa fs_size= ' + _foundset.getSize())
plugins.Log.info('ssa fs_count= ' + databaseManager.getFoundSetCount(_foundset))
}
if(databaseManager.hasRecords(_foundset.getSelectedRecord().bcom_inkoopspecregels_to_offerteregels$offergl))
{
_foundset.getSelectedRecord().bcom_inkoopspecregels_to_offerteregels$offergl.offergl_spec_edited = '*';
}
}