SmartObjects problem in V10.1C that worked in V9.D

JeffGress

New Member
I am new to SmartObjects, but maintaining an old working programing and trying to run it in 10.1C. The query is getting lost when I click on the filter button from the toolbar.

I am using setQueryWhere and Progress support send me the following to try, claiming that the where clause is lost with filter functionality, which sounds like what is happening.

Their code:

PROCEDURE InitializeObject:

RUN SUPER.
DEFINE VARIABLE cManualAddQueryWhere AS CHARACTER NO-UNDO.
DYNAMIC-FUNCTION('addQueryWhere':U IN TARGET-PROCEDURE,
INPUT "customer.custnum > 10",
input ?,
INPUT ?).

DYNAMIC-FUNCTION('openQuery':U IN TARGET-PROCEDURE).
cManualAddQueryWhere = "customer.custnum > 10" + CHR(3) + "?" + CHR(3) + "?".
{set manualAddquerywhere cManualAddQueryWhere}.

The problem I am having with this is the last statement. It tells me 'setmanualAddquerywhere' invoked dynamically, but could not be found.

I found something else called updateAddQueryWhere that looked like it might be better since it looks as though addQuerywhere will just keep adding things onto the query, essentially duplicating it and building a large redundant query.

However when I try to use this I get "could not evaluate procedure handle expression while trying to execute getProfileData". Not sure what getProfileData is exactly or why it can't find it, but this is frustrating. Any help would be appreciated. I feel like just rewriting it without SmartObjects, but I've invested/wasted too much time and need to finish this.

If someone could give me some short sample code using this I could maybe figure out what I am doing wrong.

Also when I run the dynamic functions setQueryWhere and getQueryWhere, I can put getQueryWhere in a message statement and see that the correct query is being built and passed. It's just not having any effect on the browser/viewer because the query is clearly not being used.

Thank you

updateAddQueryWhere
Procedure restores a query to design-time state, re-adds the filters, then adds and saves the new
WHERE clause.
Location: data.p
Parameters:
INPUT pcWhere AS CHARACTER
New WHERE clause.
INPUT pcField AS CHARACTER
Field to search and replace.
Data Objects and Their Methods and Properties
5–76
Notes:
• Ensures WHERE clause added is not cleared by filters, and is not duplicated in saved
manualaddquerywhere. Where clause must be in correct format for an addquerywhere. If
WHERE clause is blank but the field is passed in, then manual queries for that field are
removed and default back to all.
• Only supports adding a single where clause, but may be called many times. Used when
putting a manual filter viewer above a browser.
 
I don't have any access to OpenEdge installation at the moment therefore I am just using my memory:

When you migrated from V9 to OE10:

  • Did you copy the ADM2 code from the V9 installation or did you just try to run the application with the ADM2 code that comes with the new OE10 installation?
  • Did you re-compile all of your smart objects?

As a minimum requirement when upgrading to a newer versions of the ADM2 which come with a new installation you must re-compile all of your smart objects.

From my point of view you should better "freeze" the ADM2 in order to avoid troubles that you experience in taking a copy from the ADM2 that comes with the installation and make it part of your application.

Heavy Regards, RealHeavyDude.
 
Thanks, RealHeavyDude. I had a feeling it could be, in part, a configuration issue. That was a big help. I appreciate it.

Jeff
 
Back
Top