Search This Blog

Friday, September 29, 2017

Import and Merge XLS/CSV data into Maximo Database on Oracle

If you want to update values of certain fields inside database, one option is to make individual update statements in xl formulas as explained in another post and another option if you have huge datasets is to use MERGE commands from Oracle.


Steps:

Create a temporary table in database which will hold our data from CSV/XL

In Oracle SQL developer, click on Table and click data tab-- click action and import.

Navigate to xls/csv make sure column names match and first header has column names.

Import and accept defaults.


Now you have the database with your xl/csv data in table.
Now we will merge it with our actual table.

with below statement.



MERGE into prodtable t using ( select * from temptable) s on (t.location=s.location) 
when matched then
UPDATE SET t.fieldtoupdate = s.fieldtoupdate;


Your user should have insert update create rights on the schema where you are trying to do merge the data.

Keep Reading ! 


Thursday, September 28, 2017

Update Maximo Table Data using insert/update statements from the Excel Sheet into Oracle/SQL Server

If you want to update Maximo tables data with the new data from XLS sheet you can insert a new column in XLS

Lets say new column P

then in the formula bar use this formula if you want to generate  Update sql statements in the P column

= "update location set glaccount = '" & M1& "'  where location = '" & B1& "'"

Now if you want to generate multiple update statement in the complete P column just highlight and enter Ctrl+Enter

You will get a list of SQL statements, copy paste and run on Target Database.

Friday, September 22, 2017

Hide a field in Maximo

Go to Conditional Expression and create a new condition some thing like :fieldA <>''  (field value in mbo not null)

Go to Application designer and create a sig option for that field from select actioni -- add modify sig options.

Assign this sig option to our Field which we want to hide.

Go to Security Group and allow access for this sig option in that application and add above condition.

Sign out and re login , you should be able to see that field only when fieldA is not null.


Thursday, September 21, 2017

Create a listener on a field from another field class in Maximo

To create a field validation class we usually extend the mbovalueadapter which implements the mbovaluelistener.

If you want to create a listener on another field B from the field validation class of Field A here is the process.

Field A can have both domain and a field validation class and in our case we have a list from a table so we can extend the MaxtableDomain

In the init method of the field validation class of Field A create another instance of MboValueListener 

class FieldA extends MaxtableDomain{

public init(){
MboValueListener mvl = new OurCustomListener(getmbovalue(FieldB);
getMboValue.addListener(mvl);
}
}



In the above case as the page loads the init of Field A will create a listener in memory for field B and will listen to all 
the methods of a normal field validation class( Validat/action etc)

Implement the custom listener class 

class OurCustomListener extends mbovalueadapter {

constructor -- with mbovalue 

public action(MboValue mbv){
// this will be called whenever the FieldB changes 
}

}



So this way we can create listeners for multiple fields from one field class, this is use full for utility classes in Maximo where you don't want to change field validation at different places for FieldB but you have a generic FieldA and you can do all the changes there.