Filter set from Search Criteria

Posted by mihai_neagoe on 06-May-2014 08:08

Hi,

I installed 2.2.0 version of Rollbase and I am using the abl adapter for OE objects. I can use the Search Criteria to send the filter for read operation. This works correctly but when updating a record I get an error:

"Security Problem Cannot find data record with id xxx"

I checked in the Read operation from BusinessEntity and the filter is "?" for this request. Is there a setting I missed?

The objects were created before installing the new version and I just restarted the webserver.

Thank you,

Mihai

All Replies

Posted by Bill Wood on 06-May-2014 08:30

Can you expand on this a little?  I assume that everything was working with the pre-release of 2.2, and that this is just a change in behavior you got restarting the server.  

How did you upgrade from pre-release to release of 2.2?  

For me, I don't have a problem updating records that have been found in a Search Criteria filter.   Does it happen on a fresh install? or with a fresh OE Service Object?   The Error does not look like an OpenEdge error.

Posted by mihai_neagoe on 06-May-2014 08:53

Hi Bill,

I used a manual installation over the previous version by copying the packages from private cloud rollbase (lib and webapps). I checked with both an existing service and a new one but the same situation appears. It seems the search criteria string is set when refreshing the view (and set in the filter parameter prefixed with 'WHERE') while when updating the filter parameter is sent with '?'.

I noticed that it is possible to update one record if read operation returns a full dataset each time and Rollbase position the cursor on given id but this is not what we want achieve.

I was expecting to receive in the filter parameter something like 'PrimaryKeyField=xxx' (where xxx is the selected id) and the BusinessLogic will identify which is the record to update and populate the dataset.

I don't know if this is a change made in the release or an installation issue I have.

Posted by Bill Wood on 06-May-2014 09:10

I tried a few more cases, but I am afraid I still can’t reproduce your issue.   I am probably not going through the same steps to set up the “Edit/Save” that you are doing, but everyone I have tried works.
 
I am not surprised that there is no  automatic Filter being set.   In Rollbase 2.2, the filter is only set via the “Search Criteria” UI.  The filter is not set implicitly, as far as I know.
 
 

Posted by mihai_neagoe on 20-Jun-2014 06:22

The problem is that we emtpy the dataset in read operation on each call and build the single record for edit action based on the filter parameter. If the field is ? then no record is created so the security error is raised.

The workaround for us was to use the Rollbase cache for edit so the first line in the read operation for now is something like:

if filter = ? or filter ='' then return.

Posted by Bill Wood on 20-Jun-2014 06:47

To be clear, you are talking about what changes you made to the ABL code behind the OE Service Object.  You wanted behavior such that in the "read" method in your Business Entity Class you are doing:

METHOD PUBLIC VOID ReadObject(
            INPUT filter AS CHARACTER, 
            OUTPUT DATASET dsObject):
   /* .... skip ... */
   IF (filter EQ ?) OR (filter EQ "") THEN return.
   ELSE IF filter BEGINS "WHERE " THEN cWhere = filter.
   ELSE 
   /* ... etc... */ 

I am not sure how an UNKNOWN (?) would get passed in through the REST adapter.  

 IF (f

Posted by mihai_neagoe on 20-Jun-2014 10:00

Hi Bill,

Indeed, I am referring to the ABL Code. From our tests the filter paramter comes ? when nothing is set in the search criteria (as example when opening the page and expanding the filter) and when an edit action is made on a record.

This thread is closed