Maximo Open Forum

 View Only
  • 1.  Imported db view: How to set calculated/persistent text attribute Search Type to WILDCARD?

    Posted 11-10-2021 11:28
    Edited by User 1972 11-27-2021 00:15
    I've created a view directly in the Oracle db:

    create or replace view cgclassstructure_vw as (
    select
        classstructureid,
        listagg(objectname,', ') within group(order by objectname) as usewithconcat
    from
        maximo.classusewith
    group by
        classstructureid
    )​


    In Maximo-->DB Config, I've created a new object (an imported view). I did this by creating an object with the same name as the view that I created in the db (Object Name: CGCLASSSTRUCTURE_VW). I applied DB config changes.

    Note:
    The reason I created an imported view, instead of a non-imported view, is:
    • Only imported views can have persistent custom/calculated attributes. Non-imported view custom/calculated attributes can't be persistent. What I mean by "custom/calculated" attributes is: the column isn't an existing column from an existing object. The column is custom and likely has an SQL expression (i.e. SELECT 1+1 AS ABC ...or... SELECT WONUM AS WONUM_CUST). 
    • Persistent attributes are needed for list view filtering, reports, etc.. So I needed to create an imported view to ensure that the attributes are persistent.

    This is what the view looks like in DB Config:
    https://i.stack.imgur.com/srfO7.png
    https://i.stack.imgur.com/7LgJX.png

    Problem:
    The Search Type is read-only. I can't change it to WILDCARD.
    When I try to change the Search Type, I get this error: "BMXAA2256E - Field Search Type is read-only."
    The field was read-only even before I saved the object (while the object was still editable).


    The text field needs to have a Search Type of WILDCARD in order for me to filter on the field in the list view (and in the Advanced Search window). If the Search Type is NONE, then I can't filter on the field in Maximo.

    Summary:
    How can I set the Search Type to WILDCARD for a calculated/persistent text attribute in the imported view?


    Thanks,
    #Administration

    ------------------------------
    User 1972
    ------------------------------


  • 2.  RE: Imported db view: How to set calculated/persistent text attribute Search Type to WILDCARD?

    Posted 11-11-2021 09:15
    The answer isn't great but it requires setting it in the database and causing a cache reload (such as a restart of the system).

    ------------------------------
    Steven Shull
    IBM
    ------------------------------



  • 3.  RE: Imported db view: How to set calculated/persistent text attribute Search Type to WILDCARD?

    Posted 11-11-2021 14:19
    Thanks Steven.

    For what it's worth, here's a link to the solution you referred to: How to update Search Type if it's read only in Database Configuration

    Related RFE: View attributes: SEARCH TYPE other than NONE

    TS007493198

    ------------------------------
    User 1972
    ------------------------------



  • 4.  RE: Imported db view: How to set calculated/persistent text attribute Search Type to WILDCARD?

    Posted 11-22-2021 16:08
    Partial workaround:

    If I set EXTENDS OBJECT to WORKORDER, then it partially works. I can inherit the SEARCH TYPE from the WORKORDER table -- at least for some of the fields in my view (but not all).

    It seems to work for calculated number fields. But not calculated text fields.

    ------------------------------
    User 1972
    ------------------------------



  • 5.  RE: Imported db view: How to set calculated/persistent text attribute Search Type to WILDCARD?

    Posted 11-26-2021 18:44
    Edited by User 1972 11-27-2021 18:03
    The solution was to use MxLoader:

    1. Optional: Create the imported view object via MxLoader (or do it via the UI).
      1. The db view's columns will be automatically loaded as attributes. But the fields/values will just be the defaults...not what we want. The DB Config UI is too buggy to use...it's not possible to set the fields/values that we need via DB Config.
    2. Update the attributes via MxLoader.
      1. Update attribute fields such as:
        1. Description
        2. Title
        3. Type (datatype)*
        4. Length*
        5. Search Type*
        6. Required
        7. Persistent
        8. Default value*
      2. *Bolded fields are buggy in the Maximo UI (arbitrarily read-only, depending on the combination of values). So we update them via MxLoader instead.
    3. Apply db config changes. Works as expected.

    Summary:
    MxLoader solved all my problems. As mentioned, the the DB Config UI was too buggy to use.

    Hopefully this can save someone from the frustrations that I went through.



  • 6.  RE: Imported db view: How to set calculated/persistent text attribute Search Type to WILDCARD?

    Posted 11-27-2021 18:08
    Edited by User 1972 11-27-2021 20:45
    Details:

    I loaded these attributes from MxLoader:


    Which were synced successfully to Maximo:



    I don't think that combination of TYPE, LENGTH, SEARCH TYPE, and DEFAULT VALUE was possible via the DB Config UI. It kept making fields be read-only for no reason.
    But as far as I can tell, the MIF/business rules can handle the values ok...the sync from MxLoader worked fine. It was just the Maximo UI that was the problem.

    Notes:
    • For the UPPER fields like WONUM and SITEID, MxLoader didn't sync the LENGTH properly on the first attempt (values just stayed as the defaults). But if I ran the sync a second time, that worked. Not sure what the root cause was.
    • Initially, I had tried using Application Import/Export to sync the attributes. That worked to a degree; it was able to sync everything except the TYPE and LENGTH. So I had developed a process where I did the TYPE and LENGTH via the UI, and then did everything else via Application Import/Export. And that was successful. But ultimately, it was a lot easier just to do everything in MxLoader. Since I didn't have the issue with TYPE and LENGTH in MxLoader.


    ------------------------------
    User 1972
    ------------------------------