Problem using global methods

Hi guys,

I have a form with a couple of comboboxes in it that are based on custom valuelists. When I run the application in the development environment it loads all the values in the valuelists and everything is fine, but when I export the solution and upload it on the server, the moment it tries to open the form and load the valuelists in the comboboxes it will throw an error “can’t setup form”. The reason behind it is the relation that I use to load the dataset from is null at that time though the relation is not null when I run the application in the developer. Is there anything wrong with using relations in the global method to load some values to the valuelists when the solution is running on the server?

can anyone help me with this problem? any ideas of how can I resolve this issue?

Cheers,
Siavash

Can you show the code that you use to fill the valuelist?

There should not be any functional difference between the developer and the server, but it could for example be that your relation depends on data that is not there on the server.

Joas:
Can you show the code that you use to fill the valuelist?

There should not be any functional difference between the developer and the server, but it could for example be that your relation depends on data that is not there on the server.

Hi Joas,

Thanks for your reply. Here is the global function that I use to load the valuelist:

function emp_assignmentComboEmployees(displayValue, realValue, record, valueListName, findMode) {

	var EmpFs = databaseManager.getFoundSet(globals.DB_SERVER_NAME, 'employee');
	EmpFs.loadAllRecords();

	if(EmpFs.find()){
		EmpFs.category = '!1 || ^';
		EmpFs.datefinished = '<today || ^';
		EmpFs.search();
	}
        
        if(!utils.hasRecords(EmpFs)){
            return databaseManager.createEmptyDataSet(0, 2);
        }

	var employeeDs = databaseManager.convertToDataSet(EmpFs, ['employeecode', 'idemployee', 'employeefullname']);
	
	for (var i=1; i < employeeDs.getMaxRowIndex(); i++){
		
		var displayVal = employeeDs.getValue(i,1) + " | " + employeeDs.getValue(i,3);
		employeeDs.setValue(i,1,displayVal);
	}

	employeeDs.removeColumn(3);
	return employeeDs;

}

Cheers,
Siavash

Anyone please?

Um… We also tried to just empty the global method and return an empty dataset.
That didn’t work.
Judging from the console output it looks like the field is not there at that point or something: GlobalMethodValueList couldn’t be made for: null :shock:

[attachment=0]error.JPG[/attachment]

Please help.

Cheers,
Maria