Friday 22 November 2019

Auto Refresh Start Center | Maximo

 A small javascript snippet we will embed in the startcenter-options.jsp file to reload the page based on the interval. 


path: maximo.EAR\maximouiweb\webmodule\webclient\components\startcenter-options.jsp

just copy the below code and paste before the <table> tag in startcenter-options.jsp file:

<script type="text/javascript">

  setTimeout("location.reload(true)", 60000);

</script>


Saturday 9 November 2019

Dynamically modifiy the body of Communication Template Jython | IBM Maximo

Recently we have a requirement to modify the content of communication templates based on the record; for instance, put all the lines of a PO into the communication template before sending an email.

Also, this technique can be used to send PO to the vendor by creating a new relationship to get the email id of the vendor from Companies.

1. Create an Object Launch Point automation script with SAVE - ADD - After Save events.
2. put this code as a script. it will call an existing template, modify and send it.

 
if (mbo.getString("STATUS") == "APPR"):
      # whereclause is a string with condition to select a comm.template
      whereclause = "TEMPLATEID ='PO-APPR-MGRR'"

      # Get the Communication template via Asset relationship to send email 
      # mbo is implicit asset object through which we get a template            
      ctMboSet = mbo.getMboSet("$commtemp","COMMTEMPLATE",whereclause);
      ctMboSet.setQbeExactMatch("true")
      ctMboSet.reset()
      ctMbo = ctMboSet.getMbo(0)
     
      corcount = mbo.getMboSet("POLINE").count()
      coractionset = mbo.getMboSet("POLINE")
      txtres = " "