Monday, 28 December 2020

Split string and extract nth word in Oracle

  

Split string and extract nth word in Oracle


Here I am taking 5 word from string glaccount example 


222-333-23434-2222333-000-0000-888

select REGEXP_SUBSTR(glaccount, '[^-]+', 1, 3) AS glaccount from Workorder

Output : 23434 


Here  we are separting word with delimitter - if you have comma replace hiphen with comma.

Tuesday, 22 December 2020

Giving error in Automation Script on Object Creation or New Row

 Giving error in Maximo on New Row using Automation Script


Give exception to user on click of New Row :-


For this you need to use Object Creation type object launchpoint which is equivalent to canAdd Method in Maximo MBo's


and give this 

service.error("MESSAGEGROUP",MESSAGEKEY")

Friday, 18 December 2020

Getting Mboset from session / Getting Mboset from Memory

Getting Mboset from session / Getting Mboset from Memory  


This is typical sometimes you need to supply attribute of newly created MBO like id field to a child object which is in Memory on save of object. 


When we do getMboSet ()  we don't get this object because its in Memory and get Mboset get it from db via relationship



Inorder to do this you need to explicity get object from MXserver.getMboset() and then 

call Add() method and save it. Now in child Mbo you will get that object.

BMXAA7135E - The Boolean value of Object.attribute cannot be retrieved. BMXAA4118I - The Boolean field is blank and requires a value.

 If this error occurs in your new customization then don't change boolean value on initialize 

because at initialize it will be blank although you suppied default to 0 but it will not catch this value.