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

Hi all,

Does someone knows how to import product image in the xlsx file ?

I tried the image URL, the image encode in base64...

thank you

Like 0

Like

5 comments

Hello,

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.

Best regards,

Oscar

thank you Oscar

Do you know how to encode Line feed in the excel import file for BPM multi-line fields ?

LÉZORAY Nicolas,

 I ve got it, i replace line feed by <br/> in my SQL results, next in the xlsx file, i replace <br/> with ALT+010

LÉZORAY Nicolas,

Are you saving this into a standard field or the Notes field? When I did importing of data into the Notes field, it has never worked.

Mark Roberts, into the Notes Field it works

Show all comments

Hi everyone!

I hope you help me!

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 hope it was understood.

King regards,

Ezequiel

Like 0

Like

2 comments

Please use the following code on a replacing client module for an EmployeePage module

define("EmployeePage", [], function() {
	return {
		entitySchemaName: "Employee",
		messages: {
 
			"SearchResultBySocialNetworks": {
				mode: Terrasoft.MessageMode.BROADCAST,
				direction: Terrasoft.MessageDirectionType.SUBSCRIBE
			}
		},
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		methods: {
			subscribeSandboxEvents: function() {
				this.callParent(arguments);
				this.sandbox.subscribe("SearchResultBySocialNetworks", this.onSearchResultBySocialNetworks, this);
			},
			onSearchResultBySocialNetworks: function(config) {
				var collection = config.selectedItems;
				if (collection.isEmpty()) {
					return;
				}
				var socialContact = collection.getByIndex(0);
				this.setPhotoFromSocialNetworks(socialContact);
			},
			setPhotoFromSocialNetworks: function(socialContact) {
				var contactPhoto = this.get(this.primaryImageColumnName);
				if (!this.Ext.isEmpty(contactPhoto) || this.Ext.isEmpty(socialContact)) {
					return;
				}
				var isDefaultPhoto = socialContact.get("IsDefaultPhoto");
				var photoUrl = socialContact.get("Photo");
				if (isDefaultPhoto === true || this.Ext.isEmpty(photoUrl)) {
					return;
				}
				this.Terrasoft.ConfigurationFileApi.getImageFile(photoUrl, this.onPhotoChange, this);
			},
			onPhotoChange: function(photo) {
				if (!photo) {
					this.set(this.primaryImageColumnName, null);
					return;
				}
				this.Terrasoft.ImageApi.upload({
					file: photo,
					onComplete: this.onPhotoUploaded,
					onError: this.Terrasoft.emptyFn,
					scope: this
				});
			},
			onPhotoUploaded: function(imageId) {
				var imageData = {
					value: imageId,
					displayValue: "Photo"
				};
				this.set(this.primaryImageColumnName, imageData);
				var contactId = this.get("Contact") ? this.get("Contact").value : null;
				this.setContactPhoto(contactId, imageData);
			},
			setContactPhoto: function(contactId, imageData) {
				if (contactId) {
					var update = Ext.create("Terrasoft.UpdateQuery", {
						rootSchemaName: "Contact"
					});
					update.filters.addItem(update.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "Id",
						contactId));
					update.setParameterValue("Photo", imageData.value, Terrasoft.DataValueType.IMAGELOOKUP);
					update.execute();
				}
			}
		},
		rules: {},
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
	};
});

 

Hi Eugene! I appreciated your help! It was very useful form me. Regards!

Show all comments

Hi everyone!

How are you? I hope you can help me.

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)

How can I do this?

 

 

 

 

 

 

 

 

 

King Regards,

Ezequiel

 

Like 0

Like

2 comments

Dear Ezequiel,

 

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:

define("ContactPageV2", ["ContactPageV2Resources"],
	function(resources) {
		return {
			entitySchemaName: "Contact",
			attributes: {
				"DefaultImage": {
					dataValueType: Terrasoft.DataValueType.TEXT,
					type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN
				}
			},
			methods: {
				onEntityInitialized: function() {
					this.callParent(arguments);
					this.setPhoto();
				},
				setPhoto: function() {
					var primaryImageColumnValue = this.get(this.primaryImageColumnName);
					if (!primaryImageColumnValue) {
						var gender = this.get("Gender").value;
						if (gender === "fc2483f8-65b6-df11-831a-001d60e938c6") {
							document.getElementsByClassName("ts-image-edit-full-size-element ts-image-style-rectangular")[0]
								.setAttribute("src",
									Terrasoft.ImageUrlBuilder.getUrl(resources.localizableImages.DefaultPhotoFemale));
						} else {
							document.getElementsByClassName("ts-image-edit-full-size-element ts-image-style-rectangular")[0]
								.setAttribute("src",
									Terrasoft.ImageUrlBuilder.getUrl(resources.localizableImages.DefaultPhoto));
						}
					}
				}
			},
			diff: /**SCHEMA_DIFF*/[
			]/**SCHEMA_DIFF*/
		};
	}
);

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. 

Regards,

Anastasia

Anastasia Botezat,

one question

How can set image when onentityinitialized event is not triggered?

Show all comments