Clarity

Expand all | Collapse all

Create link from custom portlet to cost plan

mike2.2

mike2.2Aug 26, 2014 01:52 PM

  • 1.  Create link from custom portlet to cost plan

    Posted Jun 07, 2011 11:38 AM
    Hi All,

    I have a custom portlet displaying cost plan info and was wondering if there is a way to create a link from cost plan name to the cost plan property page. It seems link to cost plan is not available Thanks in advance.


  • 2.  RE: Create link from custom portlet to cost plan

    Posted Jun 07, 2011 03:10 PM
    This is great to know, I would be interested in this information as well.

    Thanks
    Tammi


  • 3.  RE: Create link from custom portlet to cost plan

    Posted Jun 07, 2011 07:09 PM
      |   view attached
    You can build the URL manually to a field which will open the cost plan detail, but that does not look good.

    Martti K.


  • 4.  RE: Create link from custom portlet to cost plan

    Posted Jun 08, 2011 11:56 AM
    I see...that wouldnt be pretty. It seems that from query other property pages are available to creat a link but not Cost Plan. Just wondering if there is a way to create one for Cost Plan. Thank you for your input tho!!


  • 5.  RE: Create link from custom portlet to cost plan

    Posted Jun 08, 2011 01:08 PM
    Thank you, I built my portlet off of the Project object, I wonder why they do not have the option to link to cost plans, just like you can link Project Name to Project Properties


  • 6.  RE: Create link from custom portlet to cost plan

    Posted Jun 08, 2011 01:45 PM
    Hi,

    i have created an link in my custom portlet.It will point to the cost plan properties page.i have enclosed an document with the necessary steps.
    Pls find the snapshots below.



    cheers,
    sundar


  • 7.  RE: Create link from custom portlet to cost plan

    Posted Jun 08, 2011 01:53 PM
    Hi Sundar,

    Here is some of my road blocks. I am Ondemand so I only have read access to the DB and my portlet is object based, not NSQL. What you have is exactly what I need.


  • 8.  RE: Create link from custom portlet to cost plan

    Posted Jun 08, 2011 02:03 PM
      |   view attached
    Tammi,

    you can do it your test / dev env and then you can ask the CA support to have an look and then do it as this in pdn env.I have enclosed an document for creating the link in project object.(Project List view)

    cheers,
    sundar


  • 9.  RE: Create link from custom portlet to cost plan

    Posted Jun 08, 2011 03:58 PM
    ... even in On demand you can run the queries to the database as dynamic lookups.

    Martti K.


  • 10.  RE: Create link from custom portlet to cost plan

    Posted Jun 08, 2011 04:38 PM
    So I can add an update statement in NSQL Query lookup, I knew I can run queries via the lookup but not update statements.


  • 11.  RE: Create link from custom portlet to cost plan

    Posted Jun 09, 2011 08:12 AM
    NOOOoooooooooooooooo
    Sorry about that, did not read all of it.
    NSQL and Lookups are just select.

    However, in spite of the the detail level instruction which I need, could not do it in V12.1SP1.

    I can create the link for project object, but as soon as update the action and restart app the link disappears from the list of links for the project object..
    I can still see it in MS SQL.

    On the other hand, if you start from cost plan, like you use the cost plan object as the data provider for a portlet. The link to cost plan detail is already OOTB. Adding a new virtual field and using that as a link should work fine. However, I get an error about not being authorized even though I have the rights to every single page and portlet in the system.

    Still more to experiment.


  • 12.  RE: Create link from custom portlet to cost plan

    Posted Jun 09, 2011 08:54 AM
      |   view attached
    Martti,

    I have used in 7.5.2 and now in 12.0.6 and it works fine.

    12.1--> Not yet but we are going to install in few days so hopefully i can test it.If in 12.1 the cost plan link itself is given in OOB then probably no need to do it.

    Normally after updating in DB the action in the created link will be missing as understandable as it is not available in system but in DB will be there.But the link will be available.

    I have also tried for creating an link to access resource financial properties but it did not work as CA pass one more additional hidden code in the URL.
    If it is id alone in the below URl we can create it.Hope they purposely used as resource financial is still not an object.

    https://workwise.standardchartered.com:9050/niku/app?action=revmgr.resourceFinancials&hdncode=5049848&id=5049848


    Cheers,
    sundar


  • 13.  RE: Create link from custom portlet to cost plan

    Posted Jun 09, 2011 11:40 AM
    Thank you guys for the ideas. I will try sundar's method to see how that works!!


  • 14.  RE: Create link from custom portlet to cost plan

    Posted Jun 09, 2011 06:51 PM
    Had to read Sundar's instructions once more.
    Thanks, they are really the level I need.
    Works fine in v12SP6 and v12.1SP1 after you publish (or restore defaults on the application side)

    Martti K.


  • 15.  RE: Create link from custom portlet to cost plan

    Posted Jun 09, 2011 06:57 PM
    There are also posts on how to deal with a long URL

    2301372

    and with a little more detail

    3658624

    Martti K.


  • 16.  RE: Create link from custom portlet to cost plan

    Posted Jun 12, 2011 08:17 AM
    Looking at little closer at the URL redirection that provides a supported method to create custom links.
    Like a link to Resources Financial properties from the Resource list and a link to Cost plans from Project list
    Examples of URL redirection in Links

    Links created in this way appear in the GUI and also in the ODF_LINKS table.

    This can also be done in On Demand without the need to access the database.

    Martti K.


  • 17.  RE: Create link from custom portlet to cost plan

    Posted Jun 12, 2011 12:20 PM
      |   view attached
    ... but I still can't figure why the standard link for the Cost Plan gives an error

    Martti K.

    Attachment(s)



  • 18.  RE: Create link from custom portlet to cost plan

    Posted Jun 13, 2011 09:51 AM
    Martti,

    I have also tested it in 12.0.6 but the standard link is not working and giving the same error which you have faced.

    It is nearly the same that is mentioned in the below KB but it says that it is fixed in 12.0.3.we have tested in 12.0.6 but it is not yet fixed.

    TEC525174 - Clarity: Using the 'Cost Plan Details' Link that is available on the 'Cost Plan Details' object does not navigate as expected - error message is generated.

    Happy that at least my custom link is working :grin:

    cheers,
    sundar


  • 19.  RE: Create link from custom portlet to cost plan

    Posted May 15, 2012 08:30 AM
    Hi Sundar,

    This is coool! I need to do the same but redirect to a costplan or benefit plan detail page...How can i achieve this? In that case, i need to pass the plan id too, right? How?

    When i checked the URL of the costplan detail page, its like this:-

    http://***.***.xxxx.***:2840/niku/app?action=revmgr.costplandetailList&id=5016503&odf_return_to=revmgr.costplanList.project%26id%3D5016503%26object_code%3Dproject%26ui.page.space%3Dmainnav.work&ui.page.space=mainnav.work&plan_id=5014060

    How can i achieve this in a custom NSQL portlet?

    Thanks,
    Georgy


  • 20.  Re: Create link from custom portlet to cost plan

    Posted Aug 29, 2014 10:23 AM

    This is helpful - sharing with our support team.  Thank you!

     

    Dale !


    1395770782
    I owe you a beer!


  • 21.  Re: Create link from custom portlet to cost plan

    Posted Aug 26, 2014 01:52 PM

    Many thanks!



  • 22.  Re: RE: Create link from custom portlet to cost plan

    Posted Aug 22, 2014 11:24 AM

    Hi!! I'm on Clarity v13.2 trying to create a link to project hierarchy tab, and I'm facing the same error message on app-ca.log

     

    WARN 2014-08-22 11:52:19,464 [http-bio-80-exec-242] caching.SecurityObjectCache (clarity:admin:7527023__CF513833-6A2B-4BCB-858C-CB06C6CCEB28:service.billOfInvestments.project) Invalid security object key: INVRECORDINV

     

     

    And from Clarity UI:

     

    error_401.JPG

     

    Have you been able to find a workaround? I know that it worked for some people in v13.3 and 13.4. Have any of you had the chance to try it as well?

     

    I appreciate your findings! Thanks a lot

    Flo.



  • 23.  Re: Create link from custom portlet to cost plan

    Posted Aug 22, 2014 11:40 AM

    The error suggests that you to not have the appropriate access to the Hierarchy tab of the subpage.

     

    Please correct the access and try again.

     

    NJ



  • 24.  Re: Create link from custom portlet to cost plan

    Posted Aug 22, 2014 11:43 AM

    Hi NJ, I do have access to the page. I can get in without errors when opening the tab from any project. The error is only threw when trying to use the link.

     

    Thanks

    Flo



  • 25.  Re: Create link from custom portlet to cost plan

    Posted Aug 23, 2014 11:37 AM

    Redirection URL (link posted by Martti) is probably the easiest approach to this. The same concept applies to the Timesheets, Action Items and other URL's which are not available OOTB or not exactly what you expect it should be doing. I have used this approach several times and works flawless. Make sure the redirection portlet and page has global access to all. When the user clicks on the link, there will be a small delay as the redirection will take you to the new page. But once it caches, then it is almost invisible.

     

    best practice -

    1. The URL in the NSQL should be relative "/niku/nu#action:revmgr.costplandetailList&id=5311405" instead of the complete URL. The way you would program this is "/niku/nu#action:revmgr.costplandetailList&id=" || to_char(project_id) ||"...the text from the actual URL ...&plan_id=" || to_char(cost_plan_id)" AS cp_link

    2. In the portlet, do not display this field as it will be a long string. And name it "Internal Cost Plan Link URL" so that the users are not trying to figure out what it is.

     

    This approach will work for on-demand as well as on-premise.



  • 26.  Re: Create link from custom portlet to cost plan

    Posted Aug 25, 2014 04:29 PM

    Hi! I'm having difficulties applying Martti's solution, and I'm not sure if I'm following the right steps because I create the link and then I understood I need to change the action for the link and need to set through a sql sentence to open the hierarchy page. In order to achieve this I first run a select against the odf_links so I can get the ID for the link. I then update the  odf_links with the ID for the action.

     

    Select * from niku.odf_links where code ='project.link_h'

     

    update niku.odf_links set action='project.link_h' where id=5056001;

     

    So I end up having something like this:

     

    IDTARGET_TYPETARGETCODEACTIONPARTITION_CODEPARTITION_MODE_CODEIS_ACTIVEIS_SYSTEMIS_PROPERTIES_LINKCREATED_DATECREATED_BYLAST_UPDATED_DATELAST_UPDATED_BYIS_OBJECT_INSTANCE_LINK
    5056001objectprojectproject.link_hproject.link_hNIKU.ROOTPARTITION_AND_ANSTRS_DESDNTS1002014-08-25 11:45:00.48312014-08-25 11:45:00.48310

     

    I think I'm doing something wrong, because when going to Clarity and checking for the action set for my new created link, I don't see project.link_h

     

    Thanks!

    Flo



  • 27.  Re: Create link from custom portlet to cost plan

    Posted Aug 26, 2014 07:49 AM

    Flo, don't update studio tables, you may break Clarity and invalidate your database. It is not supported.

    What he suggested was for you to include a concatenation of strings and attributes in NSQL to dynamically build your link and then use a html redirect to jump to that location.

    I believe we could also do that with actions in v13+ But need to investigate further.



  • 28.  Re: Create link from custom portlet to cost plan

    Posted Aug 26, 2014 10:14 AM

    Thanks Alexandre for your advice. Do you know if there is any guide that I can study so I can try to add the concadenated URL?

     

    Thanks!

    Flo



  • 29.  Re: Create link from custom portlet to cost plan

    Posted Aug 27, 2014 01:00 AM

    I'll send you an example tomorrow ;)



  • 30.  Re: Create link from custom portlet to cost plan

    Posted Aug 27, 2014 10:24 AM

    Thank you!!



  • 31.  Re: Create link from custom portlet to cost plan

    Posted Sep 01, 2014 09:06 AM

    I'm running late - trying to find the example for you. Sorry about that...



  • 32.  Re: Create link from custom portlet to cost plan

    Posted Sep 01, 2014 10:26 AM

    No problem, I wait. Hope you find it

     

    Thanks!



  • 33.  Re: Create link from custom portlet to cost plan

    Posted Sep 02, 2014 03:03 PM

    OK, so here it goes (easier to create a new example)... see if that works for you:

     

    1) Create the Query.

    SELECT @SELECT:DIM:USER_DEF:IMPLIED:FP:FP.ID:PLAN_ID@
    ,@SELECT:DIM_PROP:USER_DEF:IMPLIED:FP:FP.NAME:PLAN_NAME@
    ,@SELECT:DIM_PROP:USER_DEF:IMPLIED:FP:FP.CODE:PLAN_CODE@
    ,@SELECT:DIM_PROP:USER_DEF:IMPLIED:FP:I.NAME:INV_NAME@
    ,@SELECT:DIM_PROP:USER_DEF:IMPLIED:FP:I.CODE:INV_CODE@
    ,@SELECT:DIM_PROP:USER_DEF:IMPLIED:FP:I.ID:INV_ID@
    ,@SELECT:DIM_PROP:USER_DEF:IMPLIED:FP:'/niku/nu#action\:revmgr.costplandetailList&id='||I.ID||'&odf_return_to=npt.overview&plan_id='||FP.ID:LINK@

    FROM INV_INVESTMENTS I
      INNER JOIN FIN_PLANS FP
        on FP.OBJECT_CODE = 'project'
        and FP.OBJECT_ID = I.ID
        and FP.PLAN_TYPE_CODE='FORECAST'
    WHERE    @FILTER@

     

    2) Declare the Link on the Query - notice the action is "URL Redirect to a Clarity Page" - you need to check whether you have that page in your system. If not, let me know.

    Notice the "url" parameter will be your "LINK" attribute, the one you created in your query (in Bold Italic above).

    Query1.JPG

     

    3) This is the portlet

    Portlet1.JPG

     

    4) This is how you define the Cost Plan Link (do NOT mark Open as Pop-up):

    PortletAttribute.JPG

     

    Let me know if that's clearer

    Alex



  • 34.  Re: Create link from custom portlet to cost plan

    Posted Sep 03, 2014 10:28 AM

    Thanks Alexander!! I'll give it a try and will let you know.

     

    Regards

    Flo



  • 35.  Re: Create link from custom portlet to cost plan

    Posted Sep 03, 2014 11:17 AM

    Alexander,

     

    Is this an oracle query? because i'm getting an error message from Clarity

     

    Error:NPT-0103: Error al intentar ejecutar la consulta. Mensaje nativo: [CA Clarity][SQLServer JDBC Driver][SQLServer]Incorrect syntax near '|'. SQL Text: SELECT FP.ID PLAN_ID ,FP.NAME PLAN_NAME ,FP.CODE PLAN_CODE ,I.NAME INV_NAME ,I.CODE INV_CODE ,I.ID INV_ID ,'/niku/nu#action:revmgr.costplandetailList&id='||I.ID||'&odf_return_to=npt.overview&plan_id='||FP.ID LINK FROM INV_INVESTMENTS I INNER JOIN FIN_PLANS FP on FP.OBJECT_CODE = 'project' and FP.OBJECT_ID = I.ID and FP.PLAN_TYPE_CODE='FORECAST' WHERE 1=? and 1=1 .

     

     

    Also, I have run a select from the FIN_PLANS table, and it does not show any records, is that ok?

     

    Thanks!

    Flo



  • 36.  Re: Create link from custom portlet to cost plan

    Posted Sep 03, 2014 06:55 PM

    Yes, you will need to convert it to the corresponding sql server syntax.



  • 37.  Re: Create link from custom portlet to cost plan

    Posted Sep 03, 2014 06:56 PM

    Problem is problem || which means concatenate...



  • 38.  Re: Create link from custom portlet to cost plan

    Posted Sep 11, 2014 10:56 AM

    Hi Alex,

     

    Sorry I've been busy with other issues and wasn't able to try your suggestion. I was able to create the query on Clarity but it seems I don't have this page:

     

    2) Declare the Link on the Query - notice the action is "URL Redirect to a Clarity Page" - you need to check whether you have that page in your system. If not, let me know.

    Notice the "url" parameter will be your "LINK" attribute, the one you created in your query (in Bold Italic above).

    Query1.JPG



  • 39.  Re: Create link from custom portlet to cost plan

    Posted Sep 15, 2014 07:36 PM

    I'll send it to you tomorrow, really easy to create. I remember having published it a while ago in the old communities site, but I bet it's no longer there :)



  • 40.  Re: Create link from custom portlet to cost plan

    Posted Sep 18, 2014 06:12 AM

    Hi Alexandre,

     

    I also didn't find the Action Redirect to a Clarity Page, I'm using 12.1 release.

     

    Could you please send me how did you created the page please ?

     

    Thank you



  • 41.  Re: Create link from custom portlet to cost plan

    Posted Sep 18, 2014 10:59 AM

    Here you go, FloGoya and otahri

     

    1) Create a HTML Portlet called "URL Redirect to a Clarity Page" (or something like that) with the following text:

    <html>

    <script>

    var url = window.document.URL;

    var redirect = url.substring(0,url.indexOf("niku/")-1)+ url.substring(url.indexOf('url=')+4);

    location = redirect;

    //alert(location );

    </script>

    </html>

     

    2) Create a Portlet Page Without Tabs called "URL Redirect to a Clarity Page" (or something like that). It should be marked as "Linkable".

     

    3) Add a Link Parameter called "url" with id "url" to your page (this name is important - as it relates to the code on step 1).

     

    4) Add your portlet to the page.

     

    Voi-là Habemus Page Redirect!!!



  • 42.  Re: Create link from custom portlet to cost plan

    Posted Feb 03, 2015 06:07 AM

    Hi Alex,

    this code helped me, but when I try to go back, it returns to the redicert page and not to the list.

    I changed the code to open a new window. So while the new window is opening, the redirect back to the list.

     

    <html>

    <script>

    var url = window.document.URL;

    var redirect = url.substring(0,url.indexOf("niku/")-1)+ url.substring(url.indexOf('url=')+4);

     

    //location = redirect;

     

    window.open(redirect, '_blank');

    window.history.back();

    </script>

    </html>

     

    This is another option for using this portlet.

     

    Regards,

    Bruno Piaui