Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  Use WOTOTAL non-persistent object in WOTRACK

    Posted Tue September 07, 2021 04:43 PM
    Edited by System Admin Wed March 22, 2023 11:49 AM
    MAM 7.6.1.2:

    There is an OOB non-persistent object called WOTOTAL.

    I want to use the WOTOTAL.ACT field in WOTRACK. I've tried adding an attribute to WOTRACK using this as the attribute: WOTOTAL.ACT.

    However, that doesn't seem to be working for me. The field is either blank (list view and WO tab) or the field isn't searchable (Advanced Search --> BMXAA4185E - Cannot query on field ACT).

    Is there a way to use this non-persistent object's fields in WOTRACK?

    Thanks.







    #Maximo
    #AssetandFacilitiesManagement


  • 2.  RE: Use WOTOTAL non-persistent object in WOTRACK

    Posted Wed September 08, 2021 10:13 PM
    Edited by System Admin Wed March 22, 2023 11:52 AM

    It looks like the relationship is missing the WHERE clause. So I will need to create a new relationship (copy of WOTOTAL relationship) and include a WHERE clause.

    Example: WONUM=:WONUM AND SITEID=:SITEID.

    I also noticed that there isn't a WONUM field in that non-persistent object. So I think I'll need to create a new object (a copy of the WOTOTAL object), and add a WONUM field -- so that I can properly join the WORKORDER object to the WOTOTAL object (via the relationship).

    I don't think the above will work. See Steven Shull's comment here:
    Relationships to non-persistent tables/attributes have blank WHERE clauses


    #AssetandFacilitiesManagement
    #Maximo


  • 3.  RE: Use WOTOTAL non-persistent object in WOTRACK

    Posted Mon September 13, 2021 08:21 AM
    Edited by System Admin Wed March 22, 2023 11:47 AM


  • 4.  RE: Use WOTOTAL non-persistent object in WOTRACK

    Posted Mon September 13, 2021 11:06 PM
    Edited by System Admin Wed March 22, 2023 11:46 AM

    An untested script for populating a custom ACTTOTALCOST attribute.


    I believe WO_TASKS is a relationship on the WORKORDER object.
    From the relationship properties:
    "Relationship to the Workorder table...used to find all tasks for a workorder."
    (parent=:wonum and istask=:yes and siteid=:siteid). The resulting set will contain zero or more objects.


    children = mbo.getMboSet("WO_TASKS")     

    x = 0
    total = mbo.getDouble("ACTTOTALCOST")
    subwo = children.getMbo(x)
    while (subwo is not None):
        total += subwo.getDouble("ACTTOTALCOST")
        x=x+1
        subwo = children.getMbo(x)
    mbo.setValue("WOEQ11",str(total))
    children.close();



    #AssetandFacilitiesManagement
    #Maximo