At 11:51 AM 12/10/2008, Roberts, Jennifer wrote:

I have a variable listview, and I am trying to change the
lookupwhereclause through code.  It was working before
when the clause with written like this:

PROPERTY vlookuplist LookUpWhereClause 'WHERE LocationID
= 1 ORDER BY LastName ASC'
PROPERTY vlookuplist REFRESHLIST 'TRUE'

So why wouldn't it work like this:

PROPERTY vlookuplist LookUpWhereClause 'WHERE LOCATION =
'#39'SMC'#39' ORDER BY LastName ASC'
PROPERTY vlookuplist REFRESHLIST 'TRUE'


Jennifer,

Without know all other details, if all you are doing is
to dynamically change the where clause, try the following
approach:

01. While in form designer, use the following code for
    "WHERE Clause":

    WHERE &vWhereClause

02. Programmatically, define a vWhereClause string that
    should look similar to the following example, but
    with your scenario, etc.

    SET VAR vWhereClause TEXT = NULL
    SET VAR vWhereClause = +
    ('LocationID = 1 ORDER BY LastName ASC')

    Tip:

    You should always test the code at the R> prompt
    and make sure that there are no syntax -ERROR-s.

03. Use the following PROPERTY command to refresh the
    ListView WHERE Clause.

    PROPERTY ListViewCompID REFRESHLIST 'TRUE'
    RETURN

That's all there is to it!

For a sample application to demonstrate the use of such
feature, take a look at the "DesigningDynamicListViews"
included with 2008 SAT Sample Applications:

http://www.rupdates.com/sat2008/

Folders:

7.6: C:\RBTI\2008_RBG76_SAT\DesigningDynamicListViews
V-8: C:\RBTI\2008_RBG8_SAT\DesigningDynamicListViews

Database: DLViews
Command File: DesigningDynamicListViews.DAT

Have fun!

Very Best R:egards,

Razzak.


Reply via email to