June 7, 2012

Skip field copy when duplicating object

On almost every application Maximo provides a useful entry in the action menu to duplicate the selected record. When this action is performed, some of the field are intentionally wiped from Maximo. For example if you try to dupicate an Asset you will notice that Maximo resets some fields like ASSETNUM, LOCATION and SERIALNUM.
It may happen that you have added some custom fields on a Maximo object and you want to be cleaned when a record is duplicated. In such case, all you have to do is to override the skipCopyField(MboValueInfo mvi) method of the object's data bean.
Extend the object's class handler as described here and put the following method in the Mbo class.

@Override
protected boolean skipCopyField(MboValueInfo mvi) throws RemoteException, MXException
{
  if(mvi.getName().equals("MYCUSTOMFIELD"))
    return true;

  return super.skipCopyField(mvi);
}

Add all the fields to be skipped during the object cloning in the if statement.
Simple and straightforward as long as you know it...

TPAE 7.5

The Database Configuration Application has been enhanced in Maximo 7.5.0.3 with a new object definition menu called ‘Exclude Attribute Data’. Here you can specify the attributes that you do not want included in your new object during the duplication process. You can also control what records are excluded using an SQL condition.

11 comments:

  1. We have installed Maximo Asset Management 7.5.0.3 but do not see the 'Exclude Attribute Data' from Select Action in database configuration. What are we missing?

    ReplyDelete
    Replies
    1. I trust this IBM resource: https://www.ibm.com/developerworks/mydeveloperworks/blogs/a9ba1efe-b731-4317-9724-a181d6155e3a/entry/wanna_have_more_control_over_attribute_duplication_on_your_maximo_business_objects_mbos7?lang=en
      If it does not work you can open a PMR.

      Delete
  2. ‘Exclude Attribute Data" not visible. Have IBM MAXIMO 7.5.0.3 installed but can not see the menu option in database configuration. What is missing?

    ReplyDelete
    Replies
    1. This is where I learned this: https://www.ibm.com/developerworks/mydeveloperworks/blogs/a9ba1efe-b731-4317-9724-a181d6155e3a/entry/wanna_have_more_control_over_attribute_duplication_on_your_maximo_business_objects_mbos7
      If it doesn't work you may a leave a comment on the original article.

      Delete
  3. If you already set the security attribute for allowing access to Exclude Attribute Data, the next you have to do is, add this menu in Database Configuration "Select Action" menu.
    Open CONFIGUR applicaiton (from application designer) and Add/Modify Select Action Menu.
    click New Row, choose element type= OPTION and key value= SKIPATT. set menu position as you like. Save. Now you can see it.

    ReplyDelete
  4. Good article. If you need to execute any more logic while duplication you can use automation scripts. Create an object launch point script and type in below.
    if (mbo.getString("dupflag")=='DUPHEADER'):
    -- Any Logic you want --

    ReplyDelete
    Replies
    1. if (mbo.getString("dupflag")=='DUPHEADER'): not working

      Delete
    2. its not working for PO mbo as it gives the erro of dupflag attribute not found.

      Delete
    3. I didn't find 'dupflag' field for Job Plan.
      Need to write a script on Job Plan , whenever user Go to select action-->Click Duplicate Job plan-->After a job plan is created,he/she must get a message Save your record before making may changes.

      Pls let me know how to achieve this requirement.
      Thanks in advance!!

      Delete
  5. Gang....the Exclude Attribute Data only allows me to select user defined fields. Is there a way to select "Out of the Box" fields???

    ReplyDelete
    Replies
    1. Have You every found an answer to these ? I need to skip all the Labour Qualification data while duplicating the labour Records in maximo , how to do achieve that ?

      Delete