Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
Expand all | Collapse all

PR Record should not be saved without an attachment

  • 1.  PR Record should not be saved without an attachment

    Posted Wed November 24, 2021 03:03 AM


    ------------------------------
    Venkatrao Yenuganti
    ------------------------------

    #Maximo
    #AssetandFacilitiesManagement


  • 2.  RE: PR Record should not be saved without an attachment

    Posted Wed November 24, 2021 03:02 PM
    To add attachments the record must be saved so that PRID can be used to fill the OWNERID in DOCLINKS table. If a workflow is enabled wouldn't it be feasible to validate a condition to initiate the workflow or submit the record into workflow only if an attachment exists? the same query in your automation script can be used as an SQL statement to validate if the count of records into DOCLINKS table is greater than 0.

    ------------------------------
    Nivin Jacob George Senior Consultant
    Senior Consultant
    Praxis Solutions
    Kuwait
    ------------------------------



  • 3.  RE: PR Record should not be saved without an attachment

    Posted Mon November 29, 2021 09:41 AM
    Do this in a test environment first!

    1. Go to Application Designer
    2. Export Library.xml
    3. Find the dialog boxes you need to make Attachments work, such as id="addnewattachmentfile" (to add files), id="addnewattachmentwww" (to add URLs), and id="addfromlibrary" (to add Attachments from the Document Library).  Copy these and paste them in an editor like Notepad++
    4. In these dialog boxes, remove:          savemode="ONLOAD"
    5. In Application Designer, search for PR
    6. Open the design for PR, and export the XML
    7. Somewhere near the bottom of the file, where the rest of the dialog boxes are, paste in the edited dialog boxes you copied from Library.xml

    I've done something like this for a clone of WOTRACK where I needed to make sure the Attachment happens BEFORE Save.  The idea here is that when someone clicks the link to add an Attachment, Maximo looks for a dialog box that has the name of the event specified in the link's properties.  It will look within the current XML file first, then if it doesn't find it, it will reach out to the System XML files like Library.xml.  So you're going to make a copy that's local to PR.xml, and change its behavior.  The savemode="ONLOAD" property tells it to Save when the link is clicked.  So remove that property and it won't execute a Save.

    But, as I said, and as Nivin has pointed out, it needs the PRID in the DOCLINKS table, so test this in a test environment to make sure the links actually work correctly.


    ------------------------------
    Travis Herron
    ------------------------------