Hello,

 

We have a boolean column in accounts section. If the value is checked, we would like to add an image on the header space as highlighted in yellow in image below. Is there a sample code/ recommendation for this?

 

Like 0

Like

1 comments

Hello,

You can write a simple button and display it in the center. 

{
				"operation": "insert",
				"name": "TestContainer",
				"parentName": "ActionButtonsContainer",
				"propertyName": "items",
				"values": {
					"itemType": Terrasoft.ViewItemType.CONTAINER,
					"wrapClass": ["test-container-wrapClass"],
					"items": []
				}
			},
            {
                "operation": "insert",
                "parentName": "TestContainer",
                "propertyName": "items",
                "name": "PrimaryContactButton",
                "values": {
 
                    "itemType": Terrasoft.ViewItemType.BUTTON,
                    "click": {bindTo: "testclick"},
					"visible": {bindTo: "checkVisible"},
                    "enabled": true,
                    "style": Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
					"imageConfig": {"bindTo": "Resources.Images.EnrichedDefaultIcon"}
                }
            }

In the method checkVisible you can return true or false based on the condition.

To make it at the center just add a new CSS style:

define("AccountPageV2", ["css!UsrDStyle"], function() {

 

.test-container-wrapClass {

        margin-left: auto;

    margin-right: auto;

    width: 6em

    }

 

Show all comments

Hi Team,

 

Do you know why this add-on is no longer supported?

Last update the : 27.10.2020 and compatible till the version 7.12.4 

https://marketplace.creatio.com/app/image-preview-creatio

 

Thank you in advance!

 

Like 0

Like

6 comments

Hello Thibaut, 

 

The add-on is no longer supported as this functionality has been already implemented directly in a system. So you can now, for example, see the preview of the image attached to the case directly on the case page by only clicking on it (without downloading it). 

 

Hope it clarifies!

Best regards,

Anastasiia

Anastasiia Zhuravel,

Hello Anastasiia,

 

With this old add-on, it was also possible to view a PDF file in a popup, the same way as an image. Now, this is not possible anymore. Will this be implemented in a next release? 

We have a customer who used this add-on very frequently and is now complaining that he needs to download each PDF...

 

Kind regards,

Vincent

Vincent Tahon,

 

This functionality has been already implemented directly in a system. So you can now, for example, see the preview of the image attached to the case directly on the case page by only clicking on it (without downloading it). 



Best regards,

Bogdan

Bogdan,

Hello Bogdan,

 

This works fine for images, but not for PDF-files.

The old add-on also showed a similar preview for PDF-files, which is very convenient for our customer who uses many PDF-files.

 

Kind regards,

Vincent

Hi Community

 

Any news on this point?

we have 2 potential projects that are pending on having this feature in Creatio exactly for the same reasons described by Vincent.

pdf preview is available in most of the competition and it would be a big plus to have in Creatio as an OOB feature

thanks

Luis

Luis Tinoco Azevedo,

did you find a solution ?

Show all comments

Hi,



Is there a new way to implement this?



https://community.creatio.com/articles/receiving-link-image-added-module



Best Regards,

Solem.

Like 0

Like

3 comments
Best reply

Solem Khan Abdusalam writes:

Bogdan Spasibov,

I wanted to get the image url of my uploaded image in the module url at module.

Regards,

Solem.

And this method doesn't work for you?

https://community.creatio.com/articles/receiving-link-image-added-module

 

Best regards,

Bogdan S.

Hello Solem,

 

Can you please specify what do you mean? Do you need a way to get the same functionality without additional development that is required in the example you provided?

 

Thank you!

Bogdan Spasibov,



I wanted to get the image url of my uploaded image in the module url at module.



Regards,

Solem.

Solem Khan Abdusalam writes:

Bogdan Spasibov,

I wanted to get the image url of my uploaded image in the module url at module.

Regards,

Solem.

And this method doesn't work for you?

https://community.creatio.com/articles/receiving-link-image-added-module

 

Best regards,

Bogdan S.

Show all comments

Hello community



We have a use case where we need to migrate photos (Eg Contact display photo) into Creatio. We are aware that images are stored in the SysImage table, but 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 call API to upload an image into the SysImage table?? Subsequently we can map this Image the relevant record using the out of the box OData APIs. Few related questions below - 



1. Is the above API approach feasible?

2. I looked into what exact request was being sent and 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? 

3. What does the query parameter "fileapi16123676529964" refer to? And what is that number??

4. Believe the unique Guid() for the SysImage record is generated on the client side, sent via the fileId query param and gets stored in the Id column in the SysImage table. Is this right?

5. Besides using the 0/ImageAPIService/upload API and the DB approach, is there any other way to import/migrate images into Creatio and map them to specific records?

Like 0

Like

6 comments
Best reply

M Shrikanth,

You can create a C# code schema with the following to add an image for an account or contact from a Url. This uses the ImageAPI found in the Terrasoft.Core.ImageAPI namespace.

var url = "https://somewebsite/someimage.png";
var entityType = "Account"; // or could be Contact
var entityId = someAccountId; // or contact Id
var imageField = "AccountLogoId"; // or if a contact, use "PhotoId"
 
using (var response = (WebRequest.Create(url) as HttpWebRequest).GetResponse())
{
	using (var responseStream = response.GetResponseStream())
	{
		using (var stream = new MemoryStream())
		{
			var fileId = Guid.NewGuid();
			responseStream.CopyTo(stream);
 
			var imageApi = new ImageAPI(UserConnection);
			imageApi.Save(stream, response.ContentType, url, fileId);
 
			using (var dbExecutor = UserConnection.EnsureDBConnection())
			{
				new Update(UserConnection, entityType)
					.Set(imageField, Column.Parameter(fileId))
					.Where("Id").IsEqual(Column.Parameter(entityId))
					.Execute(dbExecutor);
			}
		}
	}
}

This could be exposed as your own web service to simplify adding images to records. 

Hope this helps.

Ryan

Hello,

 

Please either use the database upload or use the standard approach of uploading files to the "Attachments and notes" detail. The ImageAPIService service is not supposed to be used for mass file upload and the database insert is the best approach in your case.

 

Best regards,

Oscar 

Oscar Dylan,



Hi Oscar. We do not want to migrate files into "Attachments & Notes" detail but rather migrate images so that they can be set as the profile picture (Ref screenshot https://prnt.sc/ylto0l). I don't think you can upload an image to the Attachments detail and then set it as the profile picture. Can you?



1. We have images stored in AWS S3 and not available in the file system to migrate. Hence, going via API is much more preferred than going via the DB.



2. Any specific reason why ImageAPIService should not or cannot be used? It is used by the platform when a user uploads a profile picture. Then why not use it from an external system??



3. Can you qualify what you mean by "mass file upload". Our use case is to migrate images before the system is used or goes live - We do not want to use this after the system has gone live or is being used by users. Given this context, Can you help with my questions above and also the original question of what the "fileapi" query parameter refers to?



4. Is the SysImage table exposed via OData? I verified that it is. But wasn't able to insert records into it via OData. I was able to do a GET request via OData and got the following results (https://prnt.sc/ylv178). When I tried to PATCH insert the image, I get a 405 Method not allowed (https://prnt.sc/ylvdor).



5. Is the SysImage table exposed via the Excel data import option? I could not find it being exposed. Am I missing something here?



Appreciate your help Oscar!

Oscar Dylan,

Hi Oscar, Can you help with the queries above? Thanks in advance.

M Shrikanth,

You can create a C# code schema with the following to add an image for an account or contact from a Url. This uses the ImageAPI found in the Terrasoft.Core.ImageAPI namespace.

var url = "https://somewebsite/someimage.png";
var entityType = "Account"; // or could be Contact
var entityId = someAccountId; // or contact Id
var imageField = "AccountLogoId"; // or if a contact, use "PhotoId"
 
using (var response = (WebRequest.Create(url) as HttpWebRequest).GetResponse())
{
	using (var responseStream = response.GetResponseStream())
	{
		using (var stream = new MemoryStream())
		{
			var fileId = Guid.NewGuid();
			responseStream.CopyTo(stream);
 
			var imageApi = new ImageAPI(UserConnection);
			imageApi.Save(stream, response.ContentType, url, fileId);
 
			using (var dbExecutor = UserConnection.EnsureDBConnection())
			{
				new Update(UserConnection, entityType)
					.Set(imageField, Column.Parameter(fileId))
					.Where("Id").IsEqual(Column.Parameter(entityId))
					.Execute(dbExecutor);
			}
		}
	}
}

This could be exposed as your own web service to simplify adding images to records. 

Hope this helps.

Ryan

Ryan Farley,

Hi Ryan. Thanks much for the alternate approach. 

Ryan Farley,

userconnection not working
Show all comments



Dear community,

 

Is there a way to change the width of the logo?

An example is the logo from the Account page, it is square but too small...

I added a custom logo to a custom section but this one is too small.

 

Kind regards,

Yosef

Like 0

Like

2 comments

Hi Yosef,

 

Do you mean this logo: 

 

If yes, then check this Academy Article. It has an example of customizing the logo for the base section.

 

Best regards,

Bogdan S.

Bogdan Spasibov,



Thank you fro the Article. This is indeed the one I followed to insert a logo in a custom section, which worked well. The question is how to change the width, I don't see anything in this article that mentioned how to change the logo. If I change the width in the section wizard, nothing happens.

Show all comments

Hi Community,

 

Scenario : We have a added image to a section/detail. Post adding, we have an option to add another/delete the uploaded image

 

Question: Is there am option to zoom/view the uploaded the image, than view in the thumbnail size instead of increasing the image placement.

File attachments
Like 0

Like

1 comments

Hello Amritha,

 

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.

 

Best regards,

Bogdan S.

Show all comments

Hello Community,

 

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?

Like 0

Like

1 comments

Hello Shrikanth, 

 

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. 

 

Best regards, 

Olga. 

Show all comments

How can I do a mass import of image files for Contact records?

Like 0

Like

5 comments

Dear Lisa,

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.

Best regards,

Dean

Dean Parrett,

Any news about this feature?

Dear Daniel,



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. 



Kind regards,

Roman

Roman Brown,

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?

M Shrikanth,

 

Hello,

 

Let's discuss this question in a separate community thread you've created here https://community.creatio.com/questions/import-photo-image-imageapiserv…

 

Best regards,

Oscar 

Show all comments

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:

 

I have followed the following academy article to do so: https://academy.bpmonline.com/documents/technic-sdk/7-13/connected-entity-profile-control

 

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 ...):

 

 

Like 0

Like

1 comments

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.

Show all comments

Hi,

Need to show product image on section list view just like section Tile view, the product image is showing.

Do I need to extend ProductSectionV2 ?

 

Any help will be highly appreciable.

 

Regards

Like 0

Like

1 comments

Hello Muhamad,



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.



Best regards,

Alex

Show all comments