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.
Thank you! Used this just now.
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..
Funnily enough I had a similar problem which turned out to be related to the size of the custom application. There is a non persistent attribute APP (UPPER 10) present on each of the DOCINFO, DOCLINKS and and DOCTYPES objects. We had previously increased the size of the MAXAPPS.APP field to UPPER 20 and had created a custo application with the same name as the primary table (14 characters). Couldn’t work out why we where seeing any folder options. Then once we increased the size of the these non persistent fields to match the MAXPPS.APP attribute (UPPER 20), it all started working!
In my understanding you can only have one type of attachment for each application.
If you will solve this problem please let me know…
Hi… I am facing a similar issue…
Do you remember how you sorted out the problem
Thanks in advance
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.
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
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
Hi,
Thanks for posting all of this great information about doclinks! On a custom application that is a clone of plusdwotrk (but really for any application) I’d like to have a URL doclink added when I click the new record icon in the app.
I am trying to do this with an autoscript using the “undocumented hook” script name: WORKORDER.NEW. I keep getting null pointer errors.
SCRIPT
from psdi.mbo import MboConstants
if interactive and onadd and app==’CUSTOMAPP’:
#creating DOCLINKS URL record
doclinksset= mbo.getMboSet(“DOCLINKS”)
doclinks = doclinksset.add()
doclinks.setValue(“DOCUMENT”,’MapsURL’,MboConstants.NOVALIDATION|MboConstants.NOACCESSCHECK)
doclinks.setValue(“DESCRIPTION”,’SharePointDirectory Link’,MboConstants.NOVALIDATION|MboConstants.NOACCESSCHECK)
doclinks.setValue(“DOCTYPE”,’Attachments’,MboConstants.NOVALIDATION|MboConstants.NOACCESSCHECK)
doclinks.setValue(“URLTYPE”,’URL’,MboConstants.NOVALIDATION|MboConstants.NOACCESSCHECK)
doclinks.setValue(“URLNAME”,’https://maps.google.com’,MboConstants.NOVALIDATION|MboConstants.NOACCESSCHECK)
In My custom application based on PLUSGACT after adding an attachments when I save I get an error “The browse function is not supported on this browser. In your browser, enable the property Include local directory path when uploading files to a server option under security settings.” I am guessing it’s happening because “Copy document to the default location set by your administrator (recommended)?” this field is unchecked. I can’t check the box as it’s disabled. Any input is appreciated. Thanks in advance.
Hey , I have faced the same issue .
Yes it’s issue with site configuration .recheck site configuration in your organization.
Thanks ,
Akky