Maximo Open Forum

 View Only

IBM Maxmio Scripting - Reset default folder

  • 1.  IBM Maxmio Scripting - Reset default folder

    Posted 01-10-2022 08:47
    Edited by Matis Dovydas 01-10-2022 11:06
    Hello everyone,

    This script  in WOTRACK and ASSET applications when adding attachments makes default folder option as " - ".
    When adding manually files to a specific asset from attachment library (Add from Library - Create Attachments from Documents in the Library) there is part/option where you need to choose already existing folder to add this file to (Select a Folder:)
    So when this script is executed you manually add files to asset from library, point out the required folder with what it will be tied and press OKAY. Then you see an error saying to choose an appropreiate folder (BMXAA4191E - The value - is not valid for Document Folder. Specify a valid value for Document Folder) ... But when adding a new file (Add New Attachments - New File), this works fine - allows to choose the folder where the file need to be added (even when by default there is "-") without any error messages. 
    I would like to know how make default folder not the default, but only for information? Or how to make this script compatible with manual file adding, without errors?

    from psdi.mbo import MboConstants

    if mbo.getOwner() is not None:
         # reset the default value only for a specific set of applications
          if mbo.getOwner().getThisMboSet().getApp() in ("WOTRACK", "ASSET"):
               if mbo.getMboValue("DOCTYPE").getPreviousValue().asString()=="":
                    # set an invalid value so the user is forced to set a correct value
                    mbo.setValue("DOCTYPE", "-", MboConstants.NOVALIDATION)



    script by Bruno Portaluri

    #automationscripts
    #python
    #Assets
    ​​

    ------------------------------
    Matis Dovydas
    TSC
    ------------------------------