Clarity

  • 1.  Dynamic dependent lookup

    Posted Dec 03, 2009 02:07 AM
    Hi all,

    i would like to ask you for help   us with two dynamic lookups which are dependent on themselves.
    So I created first dynamic lookup. When i choose value in the first lookup then i can see only related
    values in the second dynamic lookup. In case of working like that i created an new object called
    lookups mapping. There is defined relation between values. In the end I want to please you giving some information
    about function or parametr CONSTRAIN and BROWSE-ONLY in lookups query.Thank you for your help


  • 2.  Re: Dynamic dependent lookup

    Posted Dec 03, 2009 04:18 AM
    Hi,  I hope you are looking for Parameterized Lookups. (From clarity 8.x)  Pls have a look at this KB and you can also search this forums too.  https://comm.support.ca.com/?legacyid=TEC437456    cheers,sundar


  • 3.  Re: Dynamic dependent lookup
    Best Answer

    Posted Dec 03, 2009 12:35 PM
    @BROWSE-ONLY:   :BROWSE-ONLY@ think of this NSQL construct like "dynamic comments", the sql code between is active when using the lookup, it is inactive when just displaying the data.
    Browse-only Construct for Dynamic Query Lookups
    For dynamic query lookups, browsing works in a specific way. When a record is displayed in the application, the value does not appear in the lookup field because there is no match between the value stored on the record and the list value in the lookup. The old values are retained within the database table for the instance record. However, if a record with the old value is retrieved and is not seen in the application's display, clicking the Save or Submit button removes the old value from the record.

    To retain inactivated values in the record and see them in the application, you must change the lookup query definition. For this case, the definition must include the specific NSQL construct @BROWSE-ONLY. When a user uses the lookup on new records, active values are displayed. And, when an existing record is shown with inactive values, the inactive value remains on the record.

    The syntax for this construct is :
    @BROWSE-ONLY:
    /* include SQL statement here to look at active results only */
    :BROWSE-ONLY@

    The following example shows the BROWSE-ONLY construct with a value included that defines the results that will be displayed.
    SELECT ......
    FROM .....
    WHERE @FILTER@
    @BROWSE-ONLY:
    AND IS_ACTIVE = 1
    :BROWSE-ONLY@
     Not sure there is a CONSTRAIN in NSQL. There was a section in documentation that shows an example where the parameter name contained the string constrain - but that was just a name.


  • 4.  Re: Dynamic dependent lookup

    Posted Dec 03, 2009 10:22 PM
    Thank you all guys. Was really helpful. I solve my problem :)