Clarity

 View Only
  • 1.  Creating a user capturing attribute on a custom object

    Posted Apr 12, 2015 01:06 PM

    Team:

     

    You know when you create a risk or an issue inside a project, there creator attribute is pre-populated with the user who is creating the issue or risk, and if the user wants, they can change it to someone else... is it possible to create a similar attribute on a custom object?

     

    Alternate solution is to use the created by field, but it is ALWAYS set to the creator. CA PPM does not allow to change the creator.

     

    Your input is highly appreciated. Thanks!!!



  • 2.  Re: Creating a user capturing attribute on a custom object

    Posted Apr 13, 2015 02:21 AM

    Do you need the user id saved on the database, or you only need the user name displayed on the object property page?

     

    If display the name on the object property edition pages is enough, you can try to use a parameterized dynamic lookup.

    This lookup will allow you to choose an user. But while no user is chosen, a default user is displayed.

     

    To test the concept, try to created a lookup with the following NSQL:

     

    select

      @select:tbl.id:id@,

      @select:tbl.name:name@

    from

      (select

      usr.id id,

      usr.first_name || ' ' || usr.last_name name

      from

      cmn_sec_users usr

      where

      1=1

      union select

      -1 id,

      usr.first_name || ' ' || usr.last_name name

      from

      cmn_sec_users usr

      where

      (usr.last_name || ', ' || usr.first_name) like @where:param:user_def:string:code@

      union select

      -1 id,

      'Showing the creator' name

      from

      dual

      where

      @where:param:user_def:string:code@ is null

      ) tbl

    where

      @filter@

     

    (watch out: this nsql gets all users, even inactives and locked users)

     

    Then, create a lookup field that uses the above lookup on an investment-based object (project, for example...). For the parameter code, select the 'Created By' field. And choose as default value 'Showing the creator'.

     

    That's it!

     

    Main downsides:

    - it will only show the creator user on the property edition pages. On the creation page and in the list view, you will see 'Showing the creator' instead...

    - it is not easy for the user to choose back the creator user after another user is chosen (I really don't know if this is a real downside...)

     

    Regards,

     

    Roberto Barra