Maximo Open Forum

 View Only
Expand all | Collapse all

Maximo default values in lookup - (Current date - 60) - is it possible ?

  • 1.  Maximo default values in lookup - (Current date - 60) - is it possible ?

    Posted 07-30-2024 09:58

    I'm looking to see if anyone knows of a way to default a value example last 60 days from the current date in the lookup.xml ?

    Example. This will set the default filter for 4/1/2024

    <defaultvalue dataattribute="reportdate" defaulttype="query" id="123456a" value=">4/1/2024"/>

    I don't think we can use bind variables or anything like that. Anyone have any thoughts on this ?

    Thanks


    #Administration
    #Architecture
    #Customizations
    #EverythingMaximo
    #MaximoApplicationSuite

    ------------------------------
    Ryan Medernach
    MEG ENERGY
    ------------------------------


  • 2.  RE: Maximo default values in lookup - (Current date - 60) - is it possible ?

    Posted 07-31-2024 09:54

    Hi Ryan, 
    I tried the following in the ticket lookup (SQL Server Database) 
    added a whereclause to the lookup  
    whereclause=" convert(date, reportdate) > dateadd(dd,-30,getdate()) "

    Then when I tested it in the work order tracking application - adding a related ticket, did the select value and only got the list of 9 tickets which were reported in the last month.

    Not sure if this is what you are looking for.  The only issue with this is that the lookup would never return any tickets that may have been reported more than 30 days prior.

    regards, 

    Steve Hume



    ------------------------------
    Stephen Hume
    Sheffield Scientific LLC
    ------------------------------



  • 3.  RE: Maximo default values in lookup - (Current date - 60) - is it possible ?

    Posted 08-01-2024 10:24
    Edited by Ryan Medernach 08-01-2024 10:24

    Thanks this is more what I'm looking for but the limitation may not work.

    So I'm building a custom app where the user is allowed to select any workorder (historical or in any status) but I want to limit the workorders to the most recent as that will be the most common selection. I'll try and play around with what you have provided to see if I can do something similar with the defaultvalue filter. 

    Thanks



    ------------------------------
    Ryan Medernach
    MEG ENERGY
    ------------------------------



  • 4.  RE: Maximo default values in lookup - (Current date - 60) - is it possible ?

    Posted 08-01-2024 10:48

    Ok, then what I sent earlier is not what you need.  That is for defaulting a value on an app to be saved in a field if you don't change it.

    What you want is the conditions set on the app.  Is this a hard or soft limit?  Be aware hard limits are a lot easier to do.

    If it is a hard limit, then open the app in App Designer and go to the Presentation and set a Where Clause.  Something like: ReportDate >= SysDate - 60 

    or whatever it is in your database language.



    ------------------------------
    Brad Delong
    WDW
    ------------------------------



  • 5.  RE: Maximo default values in lookup - (Current date - 60) - is it possible ?

    Posted 08-01-2024 11:12

    Ryan, with your custom app, you could then create a query and set it as the default query... that way the user will see the list of work orders filtered to the most recent, and if they want to see more they can then just click "all records".



    ------------------------------
    Stephen Hume
    Sheffield Scientific LLC
    ------------------------------



  • 6.  RE: Maximo default values in lookup - (Current date - 60) - is it possible ?

    Posted 08-01-2024 08:36
    Edited by Brad Delong 08-01-2024 09:16

    I believe you are trying to set a value in a field as the default for new records.  The way to do that without hardcoding something is to use a relationship.  I have had to do something like this and had to make a table with dates from 1/1/2000 to 1/1/2100.  There is a relationship between WorkOrder and this dates table that has the code you want like SysDate - 60 or whatever your DB language uses. 

    Maximo can only display or load data in relationships with data it already has.  So it is the date, not the datetime, in the prior example.  

    PS: This can only be done on main tables.  It is one of the questions I have asked of IBM and they swore it worked on sub-tables and I showed them it didn't.  They said they would get back with me and never did.

    Hope this helps.



    ------------------------------
    Brad Delong
    WDW
    ------------------------------



  • 7.  RE: Maximo default values in lookup - (Current date - 60) - is it possible ?

    Posted 08-01-2024 18:54

    Hi Ryan Medernach!

    In the xml definition, as far as I know, it is not possible.

    Suppose it is the SR application and you want to bring the records with the REPORTDATE date of the last 30 days.

    Define a where clause with the query:
    REPORTDATE >= TRUNC(SYSDATE - 30).

    You save it, you define it public and by default and you assign them to the different groups.

    If you want, every time someone who accesses the application SR, to see only the records with a reportdate from the last 30 days, you must edit the SR application and in "Presentation" in the definition of "Where clause" you define it, that is, " reportdate >= TRUNC(SYSDATE - 30)"

    Regards!



    ------------------------------
    Martin Fabra
    ARSAT S.A. - Actively seeking employment
    ------------------------------



  • 8.  RE: Maximo default values in lookup - (Current date - 60) - is it possible ?

    Posted 08-02-2024 22:40

    Ryan,

    If I understand what you want to do - You want to have a custom Work Order App for people to use, that defaults to work orders reported in the last 60 days when opened - right?

    You can do that in the xml, as you were thinking, but it's not LOOKUPS.XML it's WOTRACK.XML (if you want it in the default Work Order Tracking screen) or your Custom app XML (e.g. WOLOOKUP.XML).

    In the XML, find the line referencing the "beanclass=psdi.webclient.beans.workorder.WorkorderAppBean" it's the top line in WOTRACK.XML.

    At the end of that line, add a where clause (if using SQL) -

               whereclause="reportdate>getdate()-60"

    Import your modified XML and then when you open the Work Order App (or your Custom App) and hit enter the only Work Orders you will see listed are the ones reported within the last 60 days [If you want to see ALL the work orders, go to the Where clause and delete the new part "reportdate>getdate()-60"].

    I hope this helps!



    ------------------------------
    Nikolaus Despain CRL
    Aquitas Solutions
    ------------------------------



  • 9.  RE: Maximo default values in lookup - (Current date - 60) - is it possible ?

    Posted 03-05-2025 00:53

    Hi Ryan,

    try <defaultvalue dataattribute="reportdate" defaulttype="query" id="123456a" value="&gt;:today-60"/> 

    Will give you records in last 60 days from the current date.

    Cheers



    ------------------------------
    Dejan Matijas
    COSOL
    ------------------------------



  • 10.  RE: Maximo default values in lookup - (Current date - 60) - is it possible ?

    Posted 03-05-2025 10:18
    Edited by Ryan Medernach 03-05-2025 10:18

    Thanks for the suggestion Dejan but when I add this to the defaultvalue in the lookup  I see the following in the filter

    As well I have submitted an IDEA that everyone can vote on top get this functionally added into Maximo.

    https://ibm-ai-apps.ideas.ibm.com/ideas/MASM-I-1292



    ------------------------------
    Ryan Medernach
    MEG ENERGY
    ------------------------------



  • 11.  RE: Maximo default values in lookup - (Current date - 60) - is it possible ?

    Posted 03-05-2025 16:41

    You can accomplish this with a simple automation script to translate an input with a hashtag. For example if user enters #lessXX then translate to " < dd-mm-yyyy " which dd-mm-yyyy will be calculated based on " sysdate - XX " 



    ------------------------------
    Quoc Nguyen
    Freelance
    ------------------------------



  • 12.  RE: Maximo default values in lookup - (Current date - 60) - is it possible ?

    Posted 03-05-2025 17:12

    Hi Ryan

    That is correct. Filter displays that and those 1900 records on your screenshot should fall into that time period for the reportdate field i.e. last 60 days.

    Change 60 to 600 and your result set will be different.

    Wasn't that what you were trying to achieve?

    Cheers



    ------------------------------
    Dejan Matijas
    COSOL
    ------------------------------



  • 13.  RE: Maximo default values in lookup - (Current date - 60) - is it possible ?

    Posted 03-12-2025 12:08

    Dejan - No that did not work it just essentially added the text to the filter and didn't do what was expected .
    Quoc - We are trying to prevent having the user to enter the filter and that's why we are looking to get the default to work with this.

    Still need some more votes on https://ibm-ai-apps.ideas.ibm.com/ideas/MASM-I-1292 if anyone is interested in this functionality in future releases. 



    ------------------------------
    Ryan Medernach
    MEG ENERGY
    ------------------------------



  • 14.  RE: Maximo default values in lookup - (Current date - 60) - is it possible ?

    Posted 03-15-2025 23:08

    Hi,

    I think you can achieve this by introducing a non-persistent field with a Formula in the Object. Then you can use that field to the Lookup.xml file.

    Regards,

    Shahid



    ------------------------------
    Shahid Saeed Khan
    Oman Airports Management Company
    ------------------------------