Some time back I found a brilliant post in this forum about using dynamic lookup to show additional data on an Object Edit page. (sorry I can't remember the author).
Now I have a request to do the same, but to format the data to look nice.
My example is to create a list of Tasks on the Status Report Edit page. I want to do this to avoid the user jumping around to find data to support the process of making the status report.
I have used the trick with the dynamic lookup and it works fine - in the sense that I retrieve and display the data - but as yo can imagine a list of milestones without any tabular formatting is really just a long sentence of nonsense. So I want to format the output e.g. lookup like this:
Name Start End Status
Activity 1.1 01-Oct-16 15-Oct-16 Started
Activity 1.2 13-Oct-16 31-Oct-16 Not Started
Milestone 31-Oct-16 31-Oct-16 Not Started
I have tried to look in here for guidance, but did not find any. Is this possible using HTML (which I have already tried but not found successful) or in any other way?
The screen dump shows the list of milestones to the bottom right. Hopefully this can be formatted nicely :-)
You must be referring to Dave Morton's How to put any Dynamically generated Value
Displaying Database Content in HTML Portlets
for what can be done with HTML
It should be possible to do that also with html and css tags in it.
More skilled people can tell how.
Firstly, I may not recommend this approach for the said use case. However, please see if this helps.
You are almost there. In sandbox (14.4), I quickly created something to appear as below with static data. I hope you are expecting similar solution.
My lookup NSQL is below. For now I have used inline styling to avoid any conflicts with clarity CSS. But care should be taken ofcourse when defining your CSS.
SELECT @SELECT:1:id@, @SELECT:temp.val:name@FROM (
select'<html><table style="border-collapse: collapse;"> <tr> <th style="border: 1px solid #000000;font-weight:bold">Task Name</th> <th style="border: 1px solid #000000;font-weight:bold">Start</th> <th style="border: 1px solid #000000;font-weight:bold">End</th> <th style="border: 1px solid #000000;font-weight:bold">Status</th> </tr> <tr> <td style="border: 1px solid #000000;">Task1</td> <td style="border: 1px solid #000000;">01-JAN-2016</td> <td style="border: 1px solid #000000;">01-DEC-2016</td> <td style="border: 1px solid #000000;">Started</td> </tr> <tr> <td style="border: 1px solid #000000;">Task2</td> <td style="border: 1px solid #000000;">01-DEC-2016</td> <td style="border: 1px solid #000000;">31-DEC-2016</td> <td style="border: 1px solid #000000;">Not Started</td> </tr></table></html>' as valfrom dual)tempWHERE @FILTER@
Thanks for the fast response :-)
However using your example I still do not get what I expect. See the result below (this was similar to what I got when I tried my self). It seems like it don't interpretate the HTML.
The dynamic lookup is defined as:
The field (on the Status Report object) is defined as:
The field is then added to the Edit view:
And the result is unformatted text. Do you know what to do? What is missing?
Have you set the display type of the field to 'Pulldown'?
No, I didn't. Now I did and it worked :-)
Sridhar Bandaru everything is working as expected - thanks :-), but you did raise a concern as you wrote "Firstly, I may not recommend this approach for the said use case".
Could you explain why you may not recommend this? And if you could suggest more appropriate methods for the same kind of result?
I wish this trick works in future releases as well but we never know. When table size increases, the UI alignment may look bad or even cause problems to other fields alignment as well. As of now , if I have to suggest an alternative solution, how about creating a portlet with list of tasks or whatever and link it from status report actions(Internal Link). I did not try this but I think it works.
Well I see your point about the size of the table, but I could make a limit to only show e.g. max 10 records.
With regards to the Internal Link (as an alternative to a separate tab with same data) we prefer to keep navigation limited for the users.
Actually I miss (compared to other applications) that CA PPM allows configuration of create/edit pages with windows/portlets of additional information from other objects. This solution solves that (partly).
Thank you guys. Finally got my test working as well.
For me that could be an option to report when exporting with a layout.
Can only see this "trick" stopping working if CA deliberately* constrained the size or format of the "display attribute" that can be returned from a dynamic lookup - as long as something that the browser can render is encapsulated in that "display attribute" (i.e. a chunk of HTML code) then it would work.
(* - and if they did so, then they would get a lot of complaints from their customers I would imagine )
Just for reference, the original technique discussion thread (with attached "How To" document) is here ; TIP : How To Put Any Dynamically Generated Value On A Clarity Object