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

Discussion created by Dave on Nov 22, 2012
Latest reply on Sep 28, 2017 by Dave_3.0

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



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.