Maximo Open Forum

 View Only
  • 1.  How do you determine relationship names for App designer?

    Posted 02-08-2024 09:54

    Hello all,

    Someone helped me recently with what to put here for the attribute for Part 2.  My question is, how do you know what to put here?  Do you look up the tables and columns?  How can I know how to construct this relationship?

    For example, when learning another language I learned grammatical structure, therefore I can gain more understanding about a word and its meaning based upon its construction.  In the same way I'm trying to understand where, or how, to learn the language, or the structure, of what to put in these fields?  Thank you


    #Administration
    #EverythingMaximo

    ------------------------------
    Danny Richardson
    ------------------------------


  • 2.  RE: How do you determine relationship names for App designer?

    Posted 02-08-2024 10:51

    For example's sake, let's say you're configuring a field for WOTRACK.XML -- the Work Order Tracking application.

    You first have to know the base table that XML form uses; in this case, the WORKORDER table.

    Then, if the Attribute you want to add exists and persists in that table, great, just use the Attribute's name (e.g., DESCRIPTION)

    But if the Attribute is in a different table, you have to know how that table is related to this table (again, per my example, WORKORDER).  Let's suppose I want to add the Asset's Description.  So you go to the Database Configuration application, open this table (WORKORDER), and click on the Relationships tab.  Search through them until you find the correct relationship to the Child table.  In this example, I could filter the Relationships table window for Child Table = ASSET.

    As is the case here, sometimes there are multiple Relationships to that Child Table.  Read & think through which one is best for the situation.  Here, just the plain ol' ASSET relationship is what I need.

    So when configuring that field in Application Designer, the attribute would be RELATIONSHIPNAME-DOT-ATTRIBUTENAME.  In this example, we would use ASSET.DESCRIPTION      (since ASSET is the Relationship Name, then a dot, then the name of the Attribute in the Child Table, which also happens to be ASSET).

    Now let's get crazy! You can keep chaining these by dots.  Suppose you needed to add the Name/Description of the Asset's Vendor to your form.  You'd need a Relationship from WORKORDER to ASSET (which we've already covered), and then from ASSET to COMPANIES.

    The answer here would be ASSET.COMPANIES.NAME

    So that's starting at the WORKORDER object because that's our form's basis, utilizing a relationship to the Asset table called ASSET, which then utilizes a Relationship from the Asset table to the Companies table called COMPANIES, and then retrieves the value from the NAME attribute in the Companies table.

    Make sense?



    ------------------------------
    Travis Herron
    Pensacola Christian College
    ------------------------------



  • 3.  RE: How do you determine relationship names for App designer?

    Posted 02-11-2024 18:10

    Hi Danny.

    The form of the relationship name is <RELNAME>.<FIELDNAME> OR <RELNAME>.<RELNAME>.<FIELDNAME>, etc... OR :<RELNAME>.<FIELDNAME> OR <RELNAME>.<RELNAME>.<FIELDNAME>.  Please note that the difference above is subtle.  For fields within an application, they do not have a semicolon whereas when creating a relationship they do have a semicolon.  The using a semicolon also applies to Workflow and communication templates.

    Where:

    • <RELNAME> = the name of the relationship from the current object to a foreign object i..e you want to know the asset's failurecode and have it displayed on the work order.  Ignoring the fact that this does get copied to the work order, but let's us this as an example.
    • <FIELDNAME> = the attribute name from the foreign object that contains the data you wish to display.

    Steps to complete:

    1. On the foreign object, select the field in question.
    2. User ALT+F1 or ALT+I to get the field help.  This gives you the <TABLENAME> and <COLUMN> that you will need to know.
    3. Open the Database Configuration application.
    4. Find the WORKORDER object.
    5. Select the Relationship tab.
    6. Query the Child Object = ASSET.  This is because you need to establish if there is a pre-existing relationship that could meet your requirements.   Usually, yes, but if not, you'll build that relationship.  Similar to doing a SQL join.  My rule is that on the LH side of the equals sign, any field is from the child object i.e. the asset and on the RH side, I have the dot notation of the field supplying the filter data from the parent object.  Dot notation is also a relationship.  In this case, it is (usually) the field from the parent object <FIELDNAME> only.
    7. Open the Application Designer.
    8. Select the Work Order Tracking Application.
    9. Select the Work Order tab.
    10. Add a new Textbox control from the Toolbox.
    11. Update the Attribute or Attribute 2 as appropriate.
    12. Save.

    CAUTION

    Unless you want the user to be able to edit the data, please make the field read-only.

    Further

    • The relationship should only result in a 1:1 or 1:0 answer when displaying to a field.
    • A relationship is not a crossover i.e. the data still reside in the foreign object and this is why you need to think about the advised caution statement.



    ------------------------------
    Craig Kokay
    Principal Consultant
    COSOL

    email: craig.kokay@cosol.global
    #IBMChampion
    ------------------------------