Maximo Open Forum

 View Only

Requirement on item selection in prline and poline

  • 1.  Requirement on item selection in prline and poline

    Posted 04-13-2025 02:11

    I wrote an java class which does not allows to select the duplicate item.

    I am using the automation scripts to validate the same,but no luck.

    Please someone can assist me 

    Below is the java code

    package com.ibm.custom.app.ScrapDisposal;
    
    import java.rmi.RemoteException;
    import psdi.mbo.Mbo;
    import psdi.mbo.MboRemote;
    import psdi.mbo.MboSetRemote;
    import psdi.mbo.MboValue;
    import psdi.mbo.MboValueAdapter;
    import psdi.util.MXApplicationException;
    import psdi.util.MXException;
    import psdi.util.logging.MXLogger;
    import psdi.util.logging.MXLoggerFactory;
    
    public class Fldscrapitem extends MboValueAdapter {
       private static final MXLogger mylogger = MXLoggerFactory.getLogger("maximo.scrap");
    
       public Fldscrapitem(MboValue mv) {
          super(mv);
       }
    
       public void validate() throws MXException, RemoteException {
          super.validate();
          mylogger.debug("Scrap Item  validate()");
          Mbo item = this.getMboValue().getMbo();
          MboSetRemote itemset = item.getThisMboSet();
    
          for(MboRemote itemmbo = itemset.moveFirst(); itemmbo != null; itemmbo = itemset.moveNext()) {
             if (!item.equals(itemmbo) && item.getString("ITEMNUM").equals(itemmbo.getString("ITEMNUM"))) {
                String[] params = new String[]{item.getString("ITEMNUM")};
                throw new MXApplicationException("Scrap", "Same Item Entered", params);
             }
          }
    
       }
    }
        

    #Assets
    #Inventory

    ------------------------------
    SAI
    ------------------------------


Newest Episode
Ep. 8 | Going Beyond Manage with Steve Hauptman

Watch Steven Shull and Steve Hauptman discuss how Maximo teams can go beyond Manage in MAS, including Health, Monitor, Predict, AI, Scheduler, Mobile, HSE, Collaborate, and MBI.

MORE by Naviam Episode 8 cover
Watch Episode 8
Also available: Ep. 7 | Maximo UI Modernization with Jordan Smith