No announcement yet.

Custom Entity (Attachment Multiple)

  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom Entity (Attachment Multiple)

    My client wants to be able to have a PDF preview when looking at documents associated with entities. Images currently do this, and he wanted PDFs to also have a preview on the page.

    I've already written a custom view, but it only works on the Opportunities entity.
    Click image for larger version

Name:	temp.png
Views:	187
Size:	2.0 KB
ID:	22963

    You can click on the name to launch a preview window, and [Link] is the link you'd normally have. This part works completely fine!

    However... the client would like this new document view to work EVERYWHERE there is an attachmentMultiple field. (We are looking to avoid modifying the core source code, and work just with extensions, otherwise I'd just modify the attachmentMultiple code directly and be done with it.)

    Previously, I was told I had to specify this new view manually for each entity that wants to use it.

    The client is not keen to go that route, unfortunately.

    So, this afternoon, I suggested the possibility of a custom field type. I could just clone the code for attachmentMultiple, and create my own "attachmentMultipleEx" type that would specify the custom view I've written.

    Is this the right path to take? (If not, any suggestions?)

    I've gotten only part way with creating a custom field type. I can add my new attachmentMultipleEx type to Opportunity, and assign it in the Layout Manager, but once I try to list the entries... I'm running into an "Column not found: 1054 Unknown column 'opportunity.test34' in 'field list'" error when I try to view the Opportunity list. (With 'test34' just being the random name I gave it.)

    I'm sure I'm overlooking something basic; I'm not 100% familiar with how all the pieces of the system work, so whatever help I can get I'd appreciate.


  • #2

    You can specify custom view class for "attachmentMultiple" type

    Metadata > fields > attachmentMultiple

    "view": "custom:views/fields/attachment-multiple"


    • #3
      Hello Toby did you get further with this?

      Care to share your code? We're looking to handle previewing Office files via something like Google Apps document preview or OfficeApps.