Clarity

 View Only
Expand all | Collapse all

TIP : How To Put Any Dynamically Generated Value On A Clarity Object

navzjoshi00

navzjoshi00Nov 22, 2012 08:04 AM

AMoncure

AMoncureNov 26, 2012 11:23 AM

Legacy User

Legacy UserOct 21, 2015 08:25 AM

  • 1.  TIP : How To Put Any Dynamically Generated Value On A Clarity Object

    Posted Nov 22, 2012 05:05 AM
      |   view attached
    Hi,

    A number of times on the forums I have suggested or tried to explain a technique where we can put a "dynamically generated" value (be it a score, a piece of text, a URL, etc) on a object page.

    Yesterday I found myself needing to do this again, so I tried to document the technique as I went along. (I went a little way past documenting the technique though and this has resulted in the attached "HowTo" guide).

    Dave.


    --

    Summary (see document for full details)

    What this ‘technique’ does

    Allows us to display “any” sort of calculated value on a Clarity object edit-page.

    Where “any sort of calculated value” could be;


    A derived value based on the current object (similar to a calculated attribute but with much more control over the calculation

    A “looked up” value from another related object

    A dynamically generated hyperlink to another Clarity page (such as a portlet-page with a URL parameter)

    A dynamically generated hyperlink to an external system

    The result from a call to an external system (performance may be an issue here)

    Just about ANYTHING else “data-like”* that you can think of
    (* - I have not tried to get it working with images)

    How It Works

    We create a parameterized-NSQL based lookup.

    The lookup ALWAYS returns a known value (e.g. “1”) as its ‘hidden key’ and a calculated value as its “display Attribute” – the calculated value is where we derive the dynamically generated value based on the parameter.

    We then create a new attribute on the object, and use the lookup against the attribute. We need to set the attribute default to our “known value”.

    Place the attribute on the object edit page and set its values to read-only.

    .

    Attachment(s)



  • 2.  RE: TIP : How To Put Any Dynamically Generated Value On A Clarity Object

    Posted Nov 22, 2012 08:04 AM
    Thanks for sharing this Dave !!!

    NJ


  • 3.  RE: TIP : How To Put Any Dynamically Generated Value On A Clarity Object

    Posted Nov 26, 2012 11:23 AM

    Thanks for sharing this Dave!



  • 4.  RE: TIP : How To Put Any Dynamically Generated Value On A Clarity Object

    Posted Nov 27, 2012 08:05 AM
    Hi, Dave.

    Nice hack, but I'm not convinced. The way I understand this, is that all your logic is in the display part of the lookup -- meaning that the database column for the attribute in the background will always hold a "1".
    This might be OK for displaying stuff in Clarity, but it means the actual value is not available for reporting, etc. Also, as you note, you'll run into some hassle in list portlets.

    Why not just make an attribute of the desired type, make that read-only, use a process and an sql:update to correctly set the value for the attribute?

    Daniel


  • 5.  RE: TIP : How To Put Any Dynamically Generated Value On A Clarity Object

    Posted Nov 27, 2012 08:23 AM