Problem using global methods

Questions and Answers on installation, deployment, management, locking, tranasactions of Servoy Application Server

Problem using global methods

Postby siavash.roozbehan » Thu Oct 11, 2012 8:42 am

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
Siavash

TSM (The Service Manager)
Australia
siavash.roozbehan
 
Posts: 97
Joined: Wed Apr 11, 2012 2:21 am

Re: Problem using global methods

Postby Joas » Fri Oct 12, 2012 2:36 pm

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 de Haan
Yield Software Development
Need help on your project? yieldsd.com
User avatar
Joas
Site Admin
 
Posts: 842
Joined: Mon Mar 20, 2006 4:07 pm
Location: Leusden, NL

Re: Problem using global methods

Postby siavash.roozbehan » Mon Oct 15, 2012 12:51 am

Joas wrote: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:

Code: Select all
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
Siavash

TSM (The Service Manager)
Australia
siavash.roozbehan
 
Posts: 97
Joined: Wed Apr 11, 2012 2:21 am

Re: Problem using global methods

Postby siavash.roozbehan » Tue Oct 23, 2012 12:25 am

Anyone please?
Siavash

TSM (The Service Manager)
Australia
siavash.roozbehan
 
Posts: 97
Joined: Wed Apr 11, 2012 2:21 am

Re: Problem using global methods

Postby maria.kyselova » Thu Oct 25, 2012 1:18 am

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:

error.JPG
error.JPG (174.52 KiB) Viewed 3400 times


Please help.

Cheers,
Maria
Cheers,
Maria
maria.kyselova
 
Posts: 172
Joined: Thu Aug 09, 2012 12:56 am


Return to Servoy Server

Who is online

Users browsing this forum: No registered users and 12 guests