Clarity

Expand all | Collapse all

Resource (General) page: how to display info from secondary page?

  • 1.  Resource (General) page: how to display info from secondary page?

    Posted Sep 15, 2011 09:24 AM
    Searched in the boards but did not find an answer.

    Here is what I need to do:

    The Resource page (using Resource object) shows a bunch of information that the users see as R/O.

    One page I see (and they don't) is a secondary page called "Financial" which is a sub-tab of the main properties Tab in the front (home) end. In that page I can enter some pieces of information such as:
    [list]
    [*]Financial Location
    [*]Financial Department
    [*]Resource Class
    [*]Transaction Class
    [*]Vendor
    [list]

    I do not know how much of this is custom-made or standard-Clarity (before my time here). I would like to copy that information (read-only) for the users to see in the first (General) properties page for the resource as that is what they are asking for.

    I can find the "General' page in the Resource Object but I cannot find the "Financial" page definition anywhere to take a look at how it is built. Where is it?

    I know the data is kept in PAC_MNT_RESOURCES. For example, I can query the pertinent data for myself as in this quick example:

    [font=Courier New]
    SELECT r.FULL_NAME,
    pmr.LOCATIONID,
    pmr.DEPARTCODE
    FROM srm_resources r
    INNER JOIN PAC_MNT_RESOURCES pmr
    ON r.ID = pmr.id
    WHERE r.FULL_NAME LIKE 'felds%'[font]

    I can also add ODF_CA_RESOURCE to get any custom attributes for the resource object.

    How can I add these five pieces of information (fields, attributes) listed above and display them in the Resource->Properties->Main (General) page so they can see their information and not have to constantly ask?

    Alex


  • 2.  RE: Resource (General) page: how to display info from secondary page?

    Posted Sep 15, 2011 09:38 AM
    Alex,

    The Resource Financial information is not an object so you cannot configure it to bring the attributes under general page.

    cheers,
    sundar


  • 3.  RE: Resource (General) page: how to display info from secondary page?

    Posted Sep 15, 2011 10:28 AM

    sundar wrote:

    Alex,

    The Resource Financial information is not an object so you cannot configure it to bring the attributes under general page.

    cheers,
    sundar
    Ah, that's why I can't find it! Thx.

    Is there a way to obtain that information cleanly and display it in the main (general) page?

    I guess I could do it in a messy way. I could create custom attributes for the resource general page (ODF_CA_Resource) and easily display those. The issue is with populating them.

    I do not yet know how to create a custom attribute that is populated by a query, refreshed when the resource page is displayed. I have created custom attributes from static look-ups in the past but not one populated by a dynamic query.

    I could also make it in an uglier way by pre-populating these new custom attributes with a scheduled job run every night (groan).

    If I knew how to make a trigger in Clarity (if possible) I could also add a trigger to the actual create/edit process of the Financial page so when it is changed it would post to these new custom attributes (ODF_CA_Resource).

    either way would work but I would have thought there was a cleaner way to just display existing information. I mean, the Financial page already has a query built-in behind these attributes so the value is displayed every time. You can then press binoculars to search and select a new value. I would just make the front-page copy R/O. Is there a cleaner way than running update jobs nightly?


  • 4.  RE: Resource (General) page: how to display info from secondary page?
    Best Answer

    Posted Sep 15, 2011 11:13 AM
    Regardless whether Resource financial properties is an object or not there are many areas in Clarity where the configuration is not available to a user.

    If you give the right Resource - View Financial - All (or OBS based or instance) the users could see the information on subpage as read only. Would that be acceptable?

    Martti K.


  • 5.  RE: Resource (General) page: how to display info from secondary page?

    Posted Sep 19, 2011 05:21 AM
    martti,

    Is That means when the Resource - View Financial - All access rights is provided then the financial attributes can be brought out there under an subpage --> Resource-->General (Next to it)?.


    cheers,
    sundar


  • 6.  RE: Resource (General) page: how to display info from secondary page?

    Posted Sep 19, 2011 08:47 AM
    Hi Sunday,

    No, it means that the resource has the ability to view the financial sup-page for the resources. Unfortunately, the financials are pretty locked down. They have to stay where they are - there is no way to even have them display on another page. You also have to edit them on that page, you can't pull the fields onto the main resource page to view or edit them.

    Hope this helps.

    Ruthann


  • 7.  RE: Resource (General) page: how to display info from secondary page?

    Posted Sep 19, 2011 05:55 AM
    Ruth,

    i know that.

    The requirement is here to show the Resource financial attributes under Resource General page.

    In clarity If the attributes comes under an Object then we can configure.As the Financial attributes does not comes under resource object it is not possible.

    The existing one "Financial" is not an sub page which can be configured.

    If Martti's advice is to provide the access rights to view the existing Resource Financial Link as read only then ok.As it is mentioned that these attributes can be brought in a "sub page" so i got exited.

    cheers,
    sundar


  • 8.  RE: Resource (General) page: how to display info from secondary page?

    Posted Sep 19, 2011 11:57 AM
    I have a solution that lets you display "anything" (read only) in the general page of an object; "anything" being literally anything that you can derive through SQL but usually means "something that is related to the object you are looking at".

    --

    You create a dummy attribute as a lookup - one per "thing" that you want to display - set the attribute to default to "1", apply the default to all existing values and make it enter-once.

    You create the parameterised NSQL lookup, that takes the object id as a parameter and executes some clever SQL (this is where the "anything" comes in) and returns the "anything" as the display text and always returns "1" as the key value.

    (Obviously you need to create the lookup before you create the attribute!)

    Then you can place that attribute onto your general page - the underlying value will always be "1", it will always be read-only (since you have set it enter-once) but the display-value will be dynamically derived based on your clever SQL.

    --

    So in your "financial" example, you could build something that took the resource id and retrieved the relevant details from the DB (since you know where they are) to display on the screen.

    (I've posted about this before somewhere on the boards)

    EDIT : this is where I tried to explain it before (a while ago now :mellow: !!) Dynamic Query Lookup


  • 9.  RE: Resource (General) page: how to display info from secondary page?

    Posted Sep 20, 2011 05:41 AM
    Yes dave.

    Since i misread martti message (my mistake) that we can achieve this via sub page i thought some changes is brought in to bring the financial attributes in resource general in 12.1.

    I also faced to show an attribute in project general properties( some time back) but in investment object ( to show approved funds) and your post helped me.

    2302726

    For this i have created an attribute in resource object and linked to lookup below.

    select

    @SELECT:unique_name:code@,
    @SELECT:resource_class:res_class@
    FROM
    (
    select 1 id, 'code' unique_name,'1' resource_class from dual
    union all
    select r.id,r.unique_name,s.resource_class
    from
    pac_mnt_resources s,srm_resources r
    WHERE s.id = r.id
    AND ((r.unique_name IS NULL OR r.unique_name = @WHERE:PARAM:USER_DEF:STRING:Code@))
    )s
    where @FILTER@

    It is been set as an read only and enter once.The default is set as 1.

    But it always shows as 1.when i remove the read only then when i click the attribute browse i can see the correct value.
    The value is passed and it shows the correct result but not by default.

    Is am missing some thing?.


    cheers,
    sundar


  • 10.  RE: Resource (General) page: how to display info from secondary page?

    Posted Sep 20, 2011 09:55 AM
    I think the problem with your NSQL is that you are not returning '1' as the hidden key - you are returning the resource id (which does not match the '1' on the database)

    Try changing your NSQL to

    @SELECT:unique_name:code@,
    @SELECT:resource_class:res_class@
    FROM
    (
    select 1 unique_name, s.resource_class res_class
    from
    pac_mnt_resources s,srm_resources r
    WHERE s.id = r.id
    AND ((r.unique_name IS NULL OR r.unique_name = @WHERE:PARAM:USER_DEF:STRING:Code@))
    )s
    where @FILTER@

    --

    or something like that - I can't quite remember why I ever needed the dummy row returned in the lookup; I just looked at my more recent lookups like this and they don't do that

    in fact this is one of mine that works OK;;
    SELECT
    @SELECT:1:DUMMY_ID@,
    @SELECT:X.CALC_VALUE:CALC_VALUE@
    FROM
    (
    SELECT
    daves_database_package(@WHERE:PARAM:USER_DEF:INTEGER:project_id@) CALC_VALUE 
    from dual
    ) X
    WHERE @FILTER@
    With DUMMY_ID set as my hidden key and CALC_VALUE as my Display Attribute

    (obviously 'daves_database_package' is not my real database utility name)


  • 11.  RE: Resource (General) page: how to display info from secondary page?

    Posted Sep 22, 2011 07:27 AM

    another_martink wrote:

    Regardless whether Resource financial properties is an object or not there are many areas in Clarity where the configuration is not available to a user.

    If you give the right Resource - View Financial - All (or OBS based or instance) the users could see the information on subpage as read only. Would that be acceptable?

    Martti K.
    Sorry to answer late, I was out on vacation.

    This might work, but requires training and I would have to assign the permission to all managers to see their users.

    I will look into the query (NSQL) idea posted afterwards and if that one does not fit the bill, this one will be it.

    Thanks!

    Alex


  • 12.  RE: Resource (General) page: how to display info from secondary page?

    Posted Sep 29, 2011 06:23 AM
    Back to this issue. I tried going the NSQL Lookup route but can't get it to work. The main issue (besides query) is that I always get a Lookup item in the Resource General page. I only want a R/O text object displayed with the value (if any) for the vendor for the current resource I'm looking at.

    Steps I did (after APMASTER was populated with vendors and the proper relations were done to assign resources (contractors) to the vendor (staffing firm they came from).

    - CA Clarity Studio -> Queries - Created NSQL as follows:
    SELECT @SELECT:Q.DUMMYID:ID@,
    
    @SELECT:Q.Vendor : Vendor@
    FROM
    (
    
    SELECT '1' AS DUMMYID, ADDRESS_NAME AS Vendor
    
    FROM SRM_RESOURCES r
    
    INNER JOIN PAC_MNT_RESOURCES pmr
    
    ON pmr.ID = r.ID
    
    INNER JOIN APMASTER
    
    ON pmr.VENDOR_CODE = APMASTER.VENDOR_CODE
    
    WHERE @WHERE:SECURITY:RESOURCE:r.ID@
    )
    Q WHERE @FILTER@
    - Data Administration -> Lookups -> created a Dynamic Niku Query lookup "GetVendor" (I see it needs NSQL again, then why did I create the query object to begin with?)

    - Objects -> Resource -> added new custom Attribute: "vendor" and attached to GetVendor lookup created above.

    - Objects -> Resource -> Views -> Layout:Edit -> General added the new Attribute "Vendor" and displayed it in a column on the page.

    Clartiy front end, pick a resource and display their main page. I see an empty Lookup with binocs and trash can to pick (lookup). That's not what I want I want a R/O textbox with the result or blank if none.

    Obviously I'm doing this all wrong. Guidance appreciated.

    Alex


  • 13.  RE: Resource (General) page: how to display info from secondary page?

    Posted Sep 29, 2011 10:45 AM
    Hi - not fully debugging this, but;

    Your NSQL lookup needs to take a parameter (in my example above this is the "@WHERE:PARAM:USER_DEF:INTEGER:project_id@" bit) - would expect your example to take the resource id as a parameter.

    So I'd expect your NSQL in the lookup to look more like this;
    SELECT @SELECT:Q.DUMMYID:ID@,
        @SELECT:Q.Vendor : Vendor@
    FROM
    (
        SELECT '1' AS DUMMYID, ADDRESS_NAME AS Vendor
        FROM SRM_RESOURCES r
        INNER JOIN PAC_MNT_RESOURCES pmr
        ON pmr.ID = r.ID
        INNER JOIN APMASTER
        ON pmr.VENDOR_CODE = APMASTER.VENDOR_CODE
        WHERE @WHERE:SECURITY:RESOURCE:r.ID@
    [color=#fc0000]    AND r.id = @WHERE:PARAM:USER_DEF:INTEGER:resource_id@[/color]
    )
    Q WHERE @FILTER@
    Then when you do this step;
    Objects -> Resource -> added new custom Attribute: "vendor" and attached to GetVendor lookup created above.
    firstly save the attribute associated to the lookup; then you get an extra option to link the parameter in the lookup to something from the object - so choose the ID.
    I think you want to set the attribute default (to "1") and populate null values with the default at this stage too.

    --

    ?


  • 14.  RE: Resource (General) page: how to display info from secondary page?

    Posted Sep 29, 2011 11:19 AM
    OK, I'm missing the parameter. That goes to fixing the query.

    Still my main question - after the query - is how to display the item automatically in a R/O textbox in the Resource->General page. As it is now I get an empty lookup. I need to learn from this simple example as I have more complex display ones coming down the pike.

    For the moment I'm using MK's solution of just allowing them to see the Financial page (R/O) but would much prefer to display resource info in the resource page so they don't call asking for info they should be able to see (but not change).


  • 15.  RE: Resource (General) page: how to display info from secondary page?

    Posted Sep 29, 2011 08:02 AM

    Alex_Feldstein wrote:

    Still my main question - after the query - is how to display the item automatically in a R/O textbox in the Resource->General page. As it is now I get an empty lookup.
    There should be no extra mystery to this ; you put the dummy attribute on the general page, make it enter once and drop-down type

    When the page is displayed; Clarity is displaying the "1" from the underlying dummy field ; but Clarity knows that this is a lookup since that is how the attribute is implemented; so it passes the "1" to the lookup, which since it is also parameterised with the ID from the page (i.e. the resource id) returns the "display text" for the value "1".... which is what you want to see on the screen.

    Not sure I can explain this any more, I'm pretty sure I have covered all the tricks in this (and the previously linked thread).


  • 16.  RE: Resource (General) page: how to display info from secondary page?

    Posted Sep 29, 2011 02:56 PM
    I see what you mean. Still thinking like a developer in open languages/environments (e.g. C#) where place display objects (e.g. textbox) and bind them to data objects.

    I'll delve into this some more. Thanks!


  • 17.  RE: Resource (General) page: how to display info from secondary page?

    Posted Nov 22, 2012 11:57 AM
    UPDATE (Nov2012) : Worked example of the technique I'm attempting to describe above as a "tip" ;

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