Populate ACTIVE users Only under Portfolio Items - User (main user of PortfolioItem)

Under Portfolio Items view, there is a field to assign a User name to an asset i.e. the main user of the portfolio item) which is linked to the User link from AMEMPLDEPT table.  Currently, it assigns the user dependingon the UserName i.e. Last Name and First Name format e.g. LASTNAME,FIRSTNAME format. When customer starts to type the username (in lastname, firstname format) the values are getting auto-filled. However, these will also contain the Users which are no longer valid or deactivated. Is there a way to change this behavior to populate the active users (usernames) only.

As per the previous post and response, was able to figure the corrospnding page link in Application Desinger. However, unable to use the whereCondition in the filter. Attached is the screenshot for reference.

 

Previous Post - http://community.hpe.com/t5/IT-Asset-Manager-Connect-IT/How-to-add-update-User-field-under-Portfolio-Items-menu/m-p/6870232#M15317

 

  • Verified Answer

    As an example...The main portfolio item screen is amPortfolio (Full).  This screen has an oob page called "PgPItemGen" where the User link is coded.  The oob User link code is as follows...

    User|Caption="\"User of the portfolio item '\"self\"'\"" Id="Field10"

    Since oob pages cannot be customized you will have to duplicate the page (see Duplicate button on upper right-side of Designer application) and replace existing User link code with the following...

    User|WhereCond="addfiltercriteriahere" Caption="\"User of the portfolio item '\"self\"'\"" Id="Field10"

    Copy line above and paste in Notepad.

    addfiltercriteriahere - this is the logic needed to identify active users so it will go against amEmplDept even though this link is on amPortfolio.  It will help immensely if you use "Query filter" (sixth toolbar button in Client application) on amEmplDept screen to identify needed logic.  Once needed logic is identified copy/paste over addfiltercriteriahere above.

    Under Contents tab of duplicate page copy logic from Notepad and paste in white rectangle area left of "List of fields" (see attached) and either select enter keyboard key or use top blue arrow.  This will move the logic to the "List of fields" area.  From there use the other blue arrows to position where needed.  Don't forget to remove the existing User link logic being replaced.

    Before you save your changes you need to replace the oob page with new custom page under screen in question.  The second toolbar button from right (Designer application) is the "Edit screens" option which will list all screens for that table.  Highlight screen in question then select "Pages" tab.  Select new custom page under "Available pages" and move to "Pages in detail" by using the blue arrows.  From there use the other blue arrows to position where needed.  Don't forget to remove the oob page being replaced.

    Repeat for all needed pages/screens where needed.

    Save the changes then restart APM service.

    Log into new Client instance and confirm changes.

  • Excellent. Thanks a lot Mark.

    Question - can we use "Order By " clause with WhereCond mentioned below? e.g. WhereCond = "employee_active =1 Order By DHIRE DESC"

  • I have never done before and I doubt that would work but it won't hurt to try.  Remember, the system auto-populates while pausing after typing characters so ordering won't really be needed.

  • Right, it auto populates the data depending on the date created it seems i.e. the oldest record gets populated first.

    Btw, tried with adding Order by clause, it didnt worked.

     

  • I believe what is happening is the auto-ordering by primary key of employee records which makes older records list first.  I am not sure if there is a way around this.  What happens if you add to the WhereCond the following...

    " AND Max(dHire)"

  • that didnt worked.

    2016/06/23 13:36:32.000 0 1 [Thrd#:46004](0) Oracle error: ORA-00934: group function is not allowed here

  • Not really sure why you are concerned with listing order since only active employees will be listed.  The only other thought I have is adding to the WhereCond a date difference function where only the last X number of days displays.

  • Well, both the solution i.e. switching to AD\username and populating only ACTIVE users are working just fine. Its the customers requirement that they would also require to deal with inactive user ids while dealing with the assets for the former/ex-employees which needs to assign/audit with their inactive Ids (which is a valid point)

  • Don't forget from the main employees and departments screen there is a Portfolio tab which shows portfolio items used.  Maybe you can create a view/extract for the customers showing all inactive users and their associated assets?

  • Will the Validity script option be useful to customize the result populationfor User link?