Pages

April 5, 2011

How to enable doclinks in a custom Maximo application

Here is an example of how to add the attachment capability to the organizations (MULTISITE) application.
Add the ‘attachment’ control to the MULTISITE application using the Application Designer.


Then add the DOCLINKS relationship to the ORGANIZATIONS object as shown in the following picture.
Please check the 'Where Clause' statement and modify it to match your application. The where clause must be: ownertable='[MAIN_APP_OBJECT]' and ownerid=:[OBJECT_ID]
The
[MAIN_APP_OBJECT] can be retrieved in the Application Designer and the [OBJECT_ID] can be determined through the 'Indexes' tab in the Database Configuration looking for the unique/internal index.
Note that this database change does not require to run dbconfig.

The last step is to insert a row in the APPDOCTYPE table to tell Maximo that the application MULTISITE supports attachments.

For DB2 use this INSERT statement:
INSERT INTO MAXIMO.APPDOCTYPE (APP, DOCTYPE, APPDOCTYPEID) VALUES ('MULTISITE', 'Attachments', (NEXT VALUE FOR MAXIMO.APPDOCTYPESEQ));
COMMIT;

For Oracle use this INSERT statement:
INSERT INTO MAXIMO.APPDOCTYPE (APP, DOCTYPE, APPDOCTYPEID) VALUES ('MULTISITE', 'Attachments', (MAXIMO.APPDOCTYPESEQ.NEXTVAL));
COMMIT;

You can check the table content with the following query:
SELECT * FROM MAXIMO.APPDOCTYPE WHERE APP='MULTISITE';

Now you should be able to attach documents and pictures to your organization.

7 comments:

  1. Thank you! Used this just now.

    ReplyDelete
  2. I was trying to add doclinks attachment to the asset application, but related to a custom object "Certification".. so I've added the attachment component, and added the DOCLINKS relationship to Certification object, and I've checked this query:
    SELECT * FROM MAXIMO.APPDOCTYPE WHERE APP='ASSET' AND DOCTYPE='Attachments'; and it returns one row..
    But I have one problem, which is when creating new attachment, in the Certification tab, the list of folders in which I'll choose one folder to save the attachment in is not enabled, or as it has no data, meanwhile the attachments is working well in the asset tab in the same application..

    I'll be grateful for u help..

    ReplyDelete
    Replies
    1. Hi... I am facing a similar issue...
      Do you remember how you sorted out the problem

      Thanks in advance

      Delete
  3. In my understanding you can only have one type of attachment for each application.
    If you will solve this problem please let me know...

    ReplyDelete
  4. If there are more than one folders you would like to add documents from the custom application, an entry needs to be made for each of the folder names into APPDOCTYPE table. This should enable the 'Select a folder' drop down.

    ReplyDelete
  5. Bruno, Very nice article indeed!

    I'd like to add a small piece of additional info which can come very useful to anyone who may want to add the Attachment functionality to a custom-made dialog, like the one in Self-Service!

    Go to Application Designer and export the application XML and then in the XML locate the Attachment control you already added. You need to add the following to it:

    event="drviewattachments" menutype="drattachments"

    so at the end it should look something like this:



    Note that the ID is auto-generated (Do not change it) and the label is completely up to you to change

    ReplyDelete
  6. Sorry the tag did not show , it should look like this (I just removed the tags)

    OpeningXMLTag
    attachments id="1462371408752" label="Attachmentzzz" event="drviewattachments" menutype="drattachments"
    /ClosingXMLTag

    ReplyDelete

Note: Only a member of this blog may post a comment.