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
------------------------------
Original Message:
Sent: Sat November 20, 2021 10:24 PM
From: User1971
Subject: Custom bind variable?
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.)
Thanks.
Original Message:
Sent: Tue June 22, 2021 08:10 AM
From: Steven Shull
Subject: Custom bind variable?
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
Original Message:
Sent: Mon June 21, 2021 11:44 PM
From: User1971
Subject: Custom bind variable?
Is it possible to make custom bind variables in Maximo?
It's just a general curiosity question. I don't have any specific scenarios in mind, I just wondered if it was possible. And if so, it could come in handy.
Thanks.
#Maximo
#AssetandFacilitiesManagement