Tuesday 1 November 2022

Special Automation Scripts NEW, SAVE,DUPLICATE,AFTERDUPLICATE | Maximo


 <MBONAME>.NEW

 <MBONAME>.DUPLICATE

 <MBONAME>.SAVE


Introduced in 7613.

 <MBONAME>.AFTERDUPLICATE

IBM Maximo Autoscripting Guide – OBJECTNAME.DUPLICATE Script (ibm-maximo-dev.github.io)

Restrict a User to Delete an Attachment from an Approved PO | Maximo

The requirement is to lock the record so that nobody can delete a record if the purchase order is approved.

And the solution is with a small automation script on DOCLINKS object:


object: DOCLINKS

event: BEFORE SAVE

Type: Object Launch Point

Script: Jython


owner=mbo.getOwner()

if owner and owner.getName()=="PO" and owner.getInternalStatus()=="APPR" 

    service.error("","Purchase Order is approved. ")



Also ideal to control it via the signature option, create a new signature option from the application designer and grant access using the relevant security groups then just use it in your code. thanks to Steven Shull.

owner.sigopGranted("DELETEATTACH"): 



Wednesday 14 September 2022

Add plus Sign and inverted comma (+") in each line in variable | BIRT

 for beginning of the line, Find and Replace as below:

^p

^p+"    



 for End of the line, Find and Replace as below:

^p

    "^p

Sunday 12 June 2022

Standalone Lookup Using Relationship - Birt Report Parameter (Without New Attribute) || Maximo

There was a requirement of Month Parameter to be added on report runtime. The Month was already handled in the report query but we need standalone lookup just for month selection. But Maximo didn't allowed standalone lookup without linking attribute to the parameter. 

So we ended up with the below solution to add add Standalone Lookup Using Relationship - Birt Report Parameter (Without New Attribute).

Steps:

  • Add new ALN Domain with Month Values e.g. JAN, FEB, MAR....

  • Add following new Lookup changes in LOOKUPS.XML file with where clause = "DOMAINID = 'ZZMONTH' "

Wednesday 1 June 2022

Extract First or Last Date of the Week | Date functions in DAX | Power BI

 Extract the First Day of this Week

1. Go to DATA, Add new columns, 

Get Current Date Time

= TODAY()                        // current datetime

Get Current Day, Month, MonthName, Quarter, Year etc

= TODAY() // current datetime

= mytable[datecolumn].[Quarter]

= mytable[datecolumn].[Day]

= mytable[datecolumn].[Month]

= mytable[datecolumn].[Year]


Format a date using formula
todayname = format(today(),"dddd")            //format to extract the Name of the date.

Get a Week Number of a Date

weekDay= WEEKDAY(TODAY()) //return the day number, it can take 1,2,3 as parameter to start the count from saturday, sunday or monday.

Get the First Day of the Week
firstDayofThisWeek = today() - WEEKDAY(TODAY()) +1 //today - number of day +1

Get the Last Day of the Week

lastDayofThisWeek = today() - WEEKDAY(TODAY()) +7 //today - number of day +7


Get the First Day of the Month
firstDayofThisMonth = STARTOFMONTH(TODAY()) //START OF MONTH

Get the Last Day of the Month

lastDayofThisMonth = ENDOFMONTH(TODAY()) //END OF MONTH


Populate a table/column with dates in a range

ourdates = calendar(date(2022,01,01) , date(2022-01-31) ) //first and last day as parameter


Thursday 13 January 2022

Delete Outbound Error Messages from Message Reprocessing Application | IBM Maximo


Deleting error messages requires two actions. 

First the DELETEFLAG must be set to 1, then the status changed to RETRY. 

Both of these are done transparently when deleting a message in the Message Reprocessing application. In an escalation they must be done in the correct order.

Warning: Be very careful when using this escalation to delete held messages. If valid transactions are sent in while this escalation is active, and they fail due to a correctable error, they can be deleted.

In the Escalations application, create a new escalation.

Applies To: MAXINTERROR

Condition: status=status='HOLD' and queuename = 'jms/maximo/int/queues/sqout'

Add an escalation point and check the Repeat box.

Add an action. Use the lookup arrow to Go To the Actions app to create the Action.

Create a new Action with the following values:

Object: MAXINTERROR

Type: Set Value

Value: 1

Parameter/Attribute: DELETEFLAG

Save and Return with Value to the Escalations application.