You can try to take an example of code from OOB application. The schema name is BaseMessageHistoryItemPage that is placed in the Message package. The functionality is developed for the Case page and works in the following way - you just click on the picture that is placed in the Email or Portal message to enlarge it.
I have a use case where when a user uploads a contact profile photo, I need to perform specific validations - Eg Check the bit depth & file format of the image. If the bit depth or the format doesn't match, I need to reject the image and show a message to the user. These validations are complicated and sometimes not possible on the client side using JS.
I am aware that Contact profile photo gets uploaded via the out-of-the-box ImageAPIService. How do I customize or extend the service to add my own validations on the server side?
Unfortunately, we do not have the exact example of your business task realization. However, we recommend that you take a look at the following Community post where a similar task and ways of its implementation are described: https://community.creatio.com/questions/attachement
Please, let us know in case any further information is required.
Unfortunately, there is no option import images since they are stored in different table, not in Contact
Theoretically, you can upload the images encoded to base64 format into the SysImage table and then populate the pictureid column of the product with the id of the corresponding image. This process might be time consuming and not convenient, since it should be done on the database level.
We will register the idea for our R&D team to develop such a functionality that would allow to upload images in more convenient and faster way.
The mentioned development request was considered by the responsible R&D team but it's implementation was postponed due to the fact there are requests and plans with higher priority.
I will add your comment to the created request so they could take a look on it again and consider the possibility of implementing it in the next upcoming releases.
Hi Roman. We have a similar use case where we need to migrate photos and going via the Database is not an option for us.
I was looking into the 0/ImageAPIService/upload which is used by the platform internally when a Contact photo is uploaded. Can we use this API to upload an image into the SysImage table?? Few related questions below -
1. I notice a few query parameters - fileapi, totalFileLength, fileId and mimeType. If we were to replicate this request via code, Which of these are mandatory and which are optional?
2. What does the query parameter "fileapi16123676529964" refer to? And what is that number??
3. Believe the unique Guid() for the SysImage record is generated on the client side and gets stored in the Id column in the SysImage table. Is this right?
I have created a custom [Connected entity profile] on the accounts section that is a duplicate of the primary contact connected entity, except the text displays: Billing Contact:
But am unable to set the default image ?? (I.e. I want the billing contact to have the same icon as the primary contact when an entity is not yet selected for the field ...):
Please feel free to set any default image in the configuration section. In order to do it open the billing profile schema and upload the needed image in the BlankSlateIcon property. Save the schema and clean the cashe.
Unfortunately, there is no explanation how you can achieve it.
However, if you want to display record`s picture, it is highly recommended to use tile view. In list view, picture will be not useful and spoil the look of the section.
Anyway, you may try to check how this functionality is implemented out of the box and create something similar.
if we take a look at the table in DB where information on products is stored, you can see that the column which stores information on images is called "PictureId". This column takes information directly from "SysImage" table where all images are stored. The image itself is stored in "Data" column and it is stored as binary code there. Unfortunately there is no way to import data to SysImage table directly using data import tool. I will create a problem to our R&D team so to develop this functionality in future and I hope it will be implemented soon enough. As for now you need to update images manually via product page. Thank you for helping us to make our application better.
I need that when I set up the Facebook profile in the employee's "CommunicationOptions", the profile photo will be uploaded to the Employee's Photo, which would implicitly be uploaded to the Contact's Photo. This functionallity only works when done from Contact. How could I replicate it in Employee? If the Employee's photo actually refers to the Contact's photo and in Contact works fine, it should appear, since the fields configured in Employee's "Communication Options" actually refer to the associated Contact.
I need the default image of the employee to change dynamically depending if gender is Female O Male when the Photo not is set. I saw that the attribute Photo on Employee refers to Contact.Photo in attributes section of EmployeePage(Base)
You can achieve such task by applying some code modifications to the ContactPageV2. Please create or open ContactPageV2. Go to localizable strings (menu on the right) and add to Images your icon for female contacts.
Afterwards, please use this example to apply code modifications:
Here you can see, that based on the gender of the contact, the icon is set. Also, you can improve the code by adding onChange statement, which can change the icon if gender changes in runtime.