Maximo Open Forum

 View Only
  • 1.  Maximo Java Customization maximo version 7.6.0.9

    Posted 05-07-2021 02:12
    Hi all I am facing one strange issue in java 
    I am getting the set from mxserver after doing set where and reset I got count of set let's say 7 then I am traverssing using for loop 
    MboSetRemote assetSet = mx.getMboSet("ASSET", userInfo);
    assetSet.setWhere(my where clause)
    assetSet.setOrderBy(classstructureid)
    assetSet.reset()

    if (not assetSet.isEmtpy())
    {
    for (Int i= 0; (assetMbo= assetSet.getMbo(i))!= Null; i++)
    {
    if()
    {
    }
    else{
    }
    if()
    {
    }
    }
    }
    But when loop traverse it works fine for first 3 records it is working fine as soon as 4 the record loop mbo is coming null.
    Is it because of memory issue ? Or in debugging where or how can we know that why mbo is coming null which shouldn't be null as we have 7 records in set

    #Customizations

    ------------------------------
    Sahil Dutta
    xyz
    ------------------------------


  • 2.  RE: Maximo Java Customization maximo version 7.6.0.9

    Posted 05-11-2021 08:44
    Sahil,

    There shouldn't be cases where you loop over a set and only see some of the records in the set. Before looping, can you print out the count of records in the set? I'm wondering whether the where clause that you're supplying is being appended to by Maximo at all (maybe Data Restrictions, Site access, etc).

    To print the count:
    assetSet.count()

    Please note that the count() method should be used sparingly for performance reasons.

    Hope this helps.

    ------------------------------
    Alex Walter
    A3J Group, LLC
    ------------------------------