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 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.