View Only
  • 1.  Custom bind variable?

    Posted Mon June 21, 2021 11:45 PM
    Edited by User1971 Sat September 11, 2021 07:27 PM
    Is it possible to make custom bind variables in Maximo?


    RFE / Idea:
    Custom bind variables

    Related post:

    Relationship/WHERE clause has colon instead of equals sign (mbomethod:getWorkLog)

    • 2.  RE: Custom bind variable?

      Posted Tue June 22, 2021 08:11 AM
      This is an interesting idea (defining something like &FIRSTNAME&) that isn't possible today. You could link to a child object that has the value you want (which could be a non-persistent that gets populated via script) but I could see a few use cases where this would be nice. Especially since date manipulations aren't possible with the Maximo functionality.

      What I think would be more useful in context of the relationship is supporting via automation script a newer method (at least newer to me) that they added for java classes. WORKORDER->WORKLOG has a relationship WOWORKLOG that utilizes a method in the java class to determine what to return. By referencing mbomethod:getWorkLog, Maximo knows to get the java class and call the getWorkLog method to determine how to get the set. Making this a script (like script:getWorkLog) would allow you to implement complicated logic that is potentially difficult or inefficient to do with SQL.

      Steven Shull
      Director of Development
      Projetech Inc
      Cincinnati OH

    • 3.  RE: Custom bind variable?

      Posted Sat September 11, 2021 03:08 PM
      Edited by User1971 Sat November 20, 2021 10:24 PM

    • 4.  RE: Custom bind variable?

      Posted Sat November 20, 2021 10:25 PM
      Hi Steven,

      Any chance you could elaborate on this line?
      "...I could see a few use cases where this would be nice. Especially since date manipulations aren't possible with the Maximo functionality."

      (I don't think I understand the part about the dates.)


    • 5.  RE: Custom bind variable?

      Posted Mon November 22, 2021 08:39 AM
      You can already use &SYSDATE& for example to get the current date time. 

      But let's say you want your saved queries to retrieve work for the current week and your week is Monday to Sunday. Writing the SQL for that is hard for an end user because it's database platform dependent and typically involves calling multiple SQL functions to do. But if I created a variable like &MONDAY& that I populated with the date for Monday of the current week using Java calendars it would make it easier for the user to utilize in a saved query without having to understand complicated SQL logic. 

      If the bind variables expand into default values, that's another good area where things can be improved. I've seen customers want to default a date to current date + 7 days for example and you can't do that with the bind variable so you have to write an automation script for a relatively simple default. 

      This also applies to start centers where you have can change the color options but can only use < or > the current date. But some might want to add or subtract days from that to control the highlighting (IE is it overdue by 30 days). This specific example we're going to look at as part of the modernization effort of start centers but would be addressed if custom bind variables were supported. 

      Another good example not related to dates that I didn't see on your list is something like &DEFAULTSITE&, though I'd like to see that get added to core vs being a special user defined function. There's a lot of examples (especially in the mobile products) where this is retrieved via a subquery to MAXUSER which isn't terrible but seems like something that should be used from the cached UserInfo instead.

      Steven Shull

    • 6.  RE: Custom bind variable?

      Posted Tue June 22, 2021 11:49 AM
      If so, your other thread about Use an environment name viable in Communication Template? would be a great use case.

      Jason Uppenborn
      Sr. Technical Maximo Consultant
      Ontracks Consulting