Adding Attachments to a Custom Entity in Infor CRM (Saleslogix) Web

Adding support for attachments to a custom entity in Infor CRM Web is a pretty simple task as long as you know what the steps are. Luckily, the out of the box attachments SmartParts is built in a way to make it work with new custom entities without customization. It takes only 2 easy steps. Let’s take a look at the steps.

Steps to Add Attachments to a Custom Entity


STEP 1: Adding an ID property for your entity to Attachment

First, you need to add a new ID field for your custom entity to the Attachment entity. Right-click the Attachment entity and select “Modify Entity”. Then add an ID field for your entity. The name of the ID field needs to match the name of the table, not entity. If your custom entity is named “Widget”, and it’s underlying table is “WIDGET”, then add a new property to Attachment named “WidgetID”. If your custom entity is named “CMyEntity” and it’s underlying table is named “C_MYENTITY” then add a property to Attachment named “C_MyEntityID” so it matches the table name. Basically, the property name needs to be “Physical Table Name” + “ID” (the case doesn’t matter as long as the table name matches and technically it will work if you add the ID property to match the entity name instead of the table name and either will work).

Modify Attachments Entity


STEP 2: Adding the Attachments SmartPart

Add the AttachmentsList.ascx custom SmartPart to your custom entity’s page. Go to the SmartParts list for the page for your custom entity, click the “+” button, select the Custom tab and add SmartParts\Attachment\AttachmentList.ascx.

Add Attachments SmrtPart

That is it. The AttachmentList SmartPart handles all the work. Your attachment’s tab will work just like it does on any entity.

Attachments Tab on Custom Entity

Enjoy!

ABOUT THE AUTHOR

Ryan Farley

Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He’s been blogging regularly about SalesLogix since 2001 and believes in sharing with the community. He loves C#, Javascript, Python, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

1 Comment

  1. I believe there is a proviso! The custom entity must also have a populated ACCOUNTID field. Otherwise the ACCOUNTID field in the attachment entity record is left blank and only the user who added the attachment and the ADMIN user can see it in the attachment grid.

    I tested this with an OTB version (8.2.0) and added an attachment to a Product in the Detail View. The only way other users could see the attachment was by adding an ACCOUNTID (they had rights to) on the inserted record in the attachment entity.

    Therefore, if using attachments with entities that have no direct relationship to an Account then an Default AccountID needs to be added when inserting the attachment record.

    Maybe this is a bug that has been fixed or I am just plain wrong.

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) news and product updates!

You have Successfully Subscribed!