Topic
  • 5 replies
  • Latest Post - ‏2013-11-08T01:15:35Z by swkim90049
swkim90049
swkim90049
407 Posts

Pinned topic Fill in field based on data from another field

‏2013-10-22T17:07:35Z |

In Work Order Tracking, we have a custom field called department (workorder.wopm1). We also have the same custom field in person called person.department.

When someone fills out the supervisor in work order, we want Maximo to find the person.department based on the personid entered into the workorder.supervisor in the process of creating a work order.

I was thinking this is similar to cross-over domains, but not exactly.

Is this possible to do in Maximo?

  • bgbaird
    bgbaird
    282 Posts

    Re: Fill in field based on data from another field

    ‏2013-10-22T18:53:48Z  

    Kim, it can be done with a crossover domain, but if you have Automation Scripts available, that would be my choice.

     

    Let me know which.

     

    Brian

  • swkim90049
    swkim90049
    407 Posts

    Re: Fill in field based on data from another field

    ‏2013-10-22T20:09:10Z  
    • bgbaird
    • ‏2013-10-22T18:53:48Z

    Kim, it can be done with a crossover domain, but if you have Automation Scripts available, that would be my choice.

     

    Let me know which.

     

    Brian

    I am on Maximo 7.5.0.5

    I saw IBM mention an example here...

    http://pic.dhe.ibm.com/infocenter/tivihelp/v49r1/index.jsp?topic=%2Fcom.ibm.mbs.doc%2Fautoscript%2Fc_overview.html

    I am not a programmer, so I was trying to find a more specific example.

  • bgbaird
    bgbaird
    282 Posts

    Re: Fill in field based on data from another field

    ‏2013-10-23T17:06:46Z  

    I am on Maximo 7.5.0.5

    I saw IBM mention an example here...

    http://pic.dhe.ibm.com/infocenter/tivihelp/v49r1/index.jsp?topic=%2Fcom.ibm.mbs.doc%2Fautoscript%2Fc_overview.html

    I am not a programmer, so I was trying to find a more specific example.

    Here is a quick demo.  There are different and better ways, but this was fast:

    New Relationship on WORKORDER
    Child: PERSON
    Relationship: WOSUP2PERSON
    Clause:    personid = :supervisor

    New Script with Attribute Launch Point
    Launch point:    WODEMO
    Object:                WORKORDER
    Attribute;             SUPERVISOR
    Script:                 WODEMO
    Variables:          Variable:                s_department
                                Variable Type:            IN
                                Launch Point Attribute:    WOSUP2PERSON.DEPARTMENT
                    
                               Variable:                s_wopm1
                    Variable Type:            OUT
                    Launch Point Attribute:    WOPM1
                    Suppress Access Control: true
                    
    Script (jython):    s_wopm1 = s_department

  • swkim90049
    swkim90049
    407 Posts

    Re: Fill in field based on data from another field

    ‏2013-10-24T16:57:13Z  
    • bgbaird
    • ‏2013-10-23T17:06:46Z

    Here is a quick demo.  There are different and better ways, but this was fast:

    New Relationship on WORKORDER
    Child: PERSON
    Relationship: WOSUP2PERSON
    Clause:    personid = :supervisor

    New Script with Attribute Launch Point
    Launch point:    WODEMO
    Object:                WORKORDER
    Attribute;             SUPERVISOR
    Script:                 WODEMO
    Variables:          Variable:                s_department
                                Variable Type:            IN
                                Launch Point Attribute:    WOSUP2PERSON.DEPARTMENT
                    
                               Variable:                s_wopm1
                    Variable Type:            OUT
                    Launch Point Attribute:    WOPM1
                    Suppress Access Control: true
                    
    Script (jython):    s_wopm1 = s_department

    thanks bgbaird. I tried your suggestion, but I couldn't get it to work.

     

    ALN DOMAIN

    I misunderstood what my user wanted. When she fills in department, she wanted the supervisor to fill in. This ended up not being a one-to-one type relationship, so I had to create a new ALN DOMAIN called DEPTSUPE1. I used value for department, and description as the supervisor.

     

    CROSS OVER DOMAIN

    Then I created a cross over domain called DEPTSUPE2 which references DEPTSUPE1:

    Object: ALNDOMAIN

    Validation Where: domainid = 'DEPTSUPE1' and value = :wopm1 (or whatever your department field in workorder is called)

    List Where: domainid = 'DEPTSUPE1' and value = :wopm1 (or whatever your department field in workorder is called)

    Crossover Field Source: DESCRIPTION

    Crossover Field Destination: SUPERVISOR (name of field in workorder)

    Accept Null: checked

    No Overwrite: leave unchecked

     

    DATABASE CONFIGURATION

    Changed workorder.wopm1 so that it references the cross over domain (DEPTSUPE2).

    Admin Mode On > Apply Changes

     

    APPLICATION DESIGNER

    Finally, I had to go to WOTRACK, to the department field and remove the LOOKUP entry which had valuelist. You could keep it there, but the lookup is not meaningful.

    Updated on 2013-10-24T17:00:18Z at 2013-10-24T17:00:18Z by swkim90049
  • swkim90049
    swkim90049
    407 Posts

    Re: Fill in field based on data from another field

    ‏2013-11-08T01:15:35Z  

    Figured out how to use an automation script.

    Just need one IN variable v_dept

    The script itself is like this:

    if v_dept == '1126':

        mbo.setvalue("supervisor","1126supe")
     
    if v_dept == '1410':
        mbo.setvalue("supervisor","1410supe")
     
    if v_dept == '1411':
        mbo.setvalue("supervisor","1411supe")