Hello Everyone,

I have a Requirement to upload Attachment and Some header fields of Custom Object to another Application Through API. I m able to get header data from a Custom Webservice but not sure how to get attachment that can be uploaded to another Application. 

Like 0

Like

4 comments

Hi!

 

You can write a custom web service in Creatio that retrieves the required attachment(s) from the custom object, formats the data appropriately, and sends it to the other application's API using HTTP requests. Alternatively, you could look into using a pre-built integration tool or middleware solution that can facilitate the transfer of data between applications in the marketplace. As an example, if you would intend to use DocuWare for your uploaded attachments -https://marketplace.creatio.com/app/docuware-connector-creatio.

 

Hope this info was helpful.

Hi! 

 

I would like to add that you might find the relevant information about the API file attachments on this page of the Academy - https://academy.creatio.com/docs/user/setup_and_administration/base_int…

 

We will be glad to help with any other questions.

Hello Everyone ,

Well I tried Creating WebService that can get and post the Data in Attachment Section but When i Try to Get the Data Using Record id its not getting it. Can you please Advise .

Screenshot of Postman is Attached and the Code of WebService

Code : 





 

namespace Terrasoft.Configuration.UsrCustomConfigurationServiceNamespace

{

using System;

using System.ServiceModel;

using System.ServiceModel.Web;

using System.ServiceModel.Activation;

using Terrasoft.Core;

using Terrasoft.Web.Common;

using Terrasoft.Core.Entities;

using System.Collections.Generic;



[ServiceContract]

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]

public class UsrCustomConfigurationService : BaseService

{

    /* The method that creates a new record in the SysFile entity. */

    [OperationContract]

[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,

    ResponseFormat = WebMessageFormat.Json)]

public string CreateSysFileRecord(string data, string fileGroup, string id, string name, int size,

    string sysFileStorage, string type, string recordId, string recordSchemaName)

{

    UserConnection userConnection = GetUserConnection();

    EntitySchemaManager entitySchemaManager = userConnection.EntitySchemaManager;

    EntitySchema entitySchema = entitySchemaManager.GetInstanceByName("SysFile");

    Entity entity = entitySchema.CreateEntity(userConnection);

    entity.SetDefColumnValues();

    entity.SetColumnValue("Data", Convert.FromBase64String(data));

    entity.SetColumnValue("FileGroup", new Guid(fileGroup));

    entity.SetColumnValue("Id", new Guid(id));

    entity.SetColumnValue("Name", name);

    entity.SetColumnValue("Size", size);

    entity.SetColumnValue("SysFileStorage", new Guid(sysFileStorage));

    entity.SetColumnValue("Type", new Guid(type));

    entity.SetColumnValue("RecordId", new Guid(recordId));

    entity.SetColumnValue("RecordSchemaName", recordSchemaName);

    if (!entity.Save())

    {

        throw new Exception("Failed to create SysFile record");

    }

    return entity.PrimaryColumnValue.ToString();

}

/* The method that retrieves a SysFile record by ID. */

[OperationContract]

[WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,

ResponseFormat = WebMessageFormat.Json)]

public Dictionary<string, object> GetSysFileById(string id) {

    /* The default result. */

    var result = new Dictionary<string, object>();

    /* The EntitySchemaQuery instance that accesses the SysFile database table. */

    var esq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, "SysFile");

    /* Add columns to the query. */

    var colId = esq.AddColumn("Id");

    var colName = esq.AddColumn("Name");

    var colData = esq.AddColumn("Data");

    var colSize = esq.AddColumn("Size");

    var colFileGroup = esq.AddColumn("FileGroup");

    var colSysFileStorage = esq.AddColumn("SysFileStorage");

    var colType = esq.AddColumn("Type");

    var colRecordId = esq.AddColumn("RecordId");

    var colRecordSchemaName = esq.AddColumn("RecordSchemaName");

    /* Filter the query data. */

    var esqFilter = esq.CreateFilterWithParameters(FilterComparisonType.Equal, "Id", id);

    esq.Filters.Add(esqFilter);

    /* Retrieve the query results. */

    var entities = esq.GetEntityCollection(UserConnection);

    /* If the service receives data. */

    if (entities.Count > 0)

    {

        var entity = entities[0];

        /* Add the values of the record fields to the result dictionary. */

        result.Add("Id", entity.GetTypedColumnValue<Guid>(colId.Name));

        result.Add("Name", entity.GetTypedColumnValue<string>(colName.Name));

        result.Add("Data", entity.GetTypedColumnValue<byte[]>(colData.Name));

        result.Add("Size", entity.GetTypedColumnValue<int>(colSize.Name));

        result.Add("FileGroup", entity.GetTypedColumnValue<Guid>(colFileGroup.Name));

        result.Add("SysFileStorage", entity.GetTypedColumnValue<Guid>(colSysFileStorage.Name));

        result.Add("Type", entity.GetTypedColumnValue<Guid>(colType.Name));

        result.Add("RecordId", entity.GetTypedColumnValue<Guid>(colRecordId.Name));

        result.Add("RecordSchemaName", entity.GetTypedColumnValue<string>(colRecordSchemaName.Name));

    }

    // Return the results.

    return result;

}

}

}

Show all comments

Dear mates,

PDF attachments are not visible on iPhone using Mail app.

Has anyone had this problem ?

How can I correct this problem ?

Email are generate by process: an email activity open on the sender Creatio screen with the file insert as attachment.

We follow this documentation from Ryan Farley:

https://customerfx.com/article/running-a-word-printable-in-a-process-sc…

The attached files appear well on other email clients...

Thank you !

Nicolas

Like 0

Like

4 comments

Hello Nicolas,

 

Since other email clients work as expected - it seems that the issue is limited to iOS and not connected to Creatio specifically.

 

I tried looking for similar problems on the web. Here is an example, perhaps you have a similar issue:

https://discussions.apple.com/thread/7491137

 

Best Regards,

Dan

Hello,

Patrice from the Nicolas team here.

This issue is not resolved from our side, so i tried to investigate a bit more about it :



I tried sending an email with attachment from Creatio, then read it from an iPhone.

Then sent  an email with same attachment from thunderbird.

 

The email sent from Creatio do no show the attachment, while the one sent from thunderbird works fine.



Having a look at the email source show some differences around the MIME structure :

 

the email sent from thunderbird has that structure :

Content-Type: multipart/mixed;

Content-Type: text/plain;

Content-Type: application/pdf;

 

The email sent from Creatio has that structure : 

Content-Type: multipart/related;

Content-Type: multipart/alternative;

Content-Type: text/plain;

Content-Type: application/pdf;

 

according to that documentation https://learn.microsoft.com/en-us/previous-versions/office/developer/ex…

it seems that Creatio should use multipart/mixed as root..

 

So depending of the email client, the attachment may show or not. 

 

 

I'm not 100% sure of this as i'm not used to that topic, but maybe it's worth checking ?

 

Best regards

Patrice

Patrice-ABPost,

 

Is the issue reproducing only on IOS?

Hello Bogdan,

 

yes, so far, there is no complains with other  platform..

Show all comments

Is there any way to restrict number of file to be attached in the attachment detail tab.

I need a situation like user have to attach only one file in the section wizard and not more than that

Like 0

Like

2 comments

Hello,

 

Your business task requires additional development, as of now it cannot be achieved with basic tools only. 

 

We've registered a query for our responsible R&D team to implement the described functionality in the upcoming versions of a system.



Best regards,

Anastasiia

Kavya,

 

To achieve your business task follow the below approach,

Create a replacing module for "FileDetailV2" and add the below code,

define("FileDetailV2", [], function() {
	return {
		mixins: {},
		attributes: {},
		methods: {
			onFileSelect: function(files) {
				var fileSchemaName = this.entitySchemaName;
				if(files.length &gt; 1 &amp;&amp; fileSchemaName == "UsrCustomObjectFile"){ //Your file object name goes here
					this.showInformationDialog("More than 1 files are not allowed.");
					return;
				}else{
					this.callParent(arguments);
				}
			},
			upload: function(config, callback) {
				var fileSchemaName = this.entitySchemaName;
				if(fileSchemaName == "UsrCustomObjectFile"){ //Your file object name goes here
					this.CustomAttachmentCountValidation(config);
				}else{
					this.callParent(arguments);
				}
			},
			CustomAttachmentCountValidation: function(config, callback){
				var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
					rootSchemaName: this.entitySchemaName 
				});
				esq.filters.addItem(esq.createColumnFilterWithParameter(
					Terrasoft.ComparisonType.EQUAL, "UsrConnectedColumn", this.get("MasterRecordId")));	//Master entity Connected column
				esq.getEntityCollection(function (result) {
					if (result.success &amp;&amp; result.collection.getCount() &gt; 0) {
						this.showInformationDialog("More than 1 files are not allowed.");
					}else {
						this.Terrasoft.ConfigurationFileApi.upload(config, callback);
					}
				}, this);
			},
		}
	};
});

Let me know if this helps in achieving your objective.

 

Warm Regards,

Sourav Kumar Samal

Show all comments

Hello!

 

Is there a way to block adding attachments and notes on any section. I want to do this on the Lead and Opportunity according to the Stage. If the Stage is Inactive. I won't be able to add any attachments and notes.

 

Thank you!

Like 0

Like

1 comments

 Hello,

 

Here is an example on how to achieve this in opportunity page:

 

1) Add the boolean column in the Opportunity edit page. The code for the column should be "UsrInactiveStatus". Save this change.

2) Create a business process that will set the value to true or false in case the status of the opportunity is either active or inactive (use "record modified" trigger signal which triggers on the opportunity modification in the "Stage" column (be careful not to cycle the business process, it's as a must to select the "Stage" column as a column that triggers the process)). Also at the end of the process execution it should refresh the current opporutnity page (use this marketplace app to achive this task).

3) Create a replacing view model for the "FileDetailV2" module and add the following code to the module:

define("FileDetailV2", [], function() {
	return {
		mixins: {},
		properties: {},
		attributes: {},
		messages: {},
		methods: {
			upload: function(config, callback) {
				var isOpportunityAttachment = config.entitySchemaName == "OpportunityFile";
				var canUploadFile = this.getIsCurrentStatusActive();
				if (isOpportunityAttachment &amp;&amp; canUploadFile) {
					this.callParent(arguments);
				} else {
					Terrasoft.showErrorMessage("Current status is inactive, uploading restricted");
				}
			},
			getIsCurrentStatusActive: function() {
				var columnsValuesObject = this.sandbox.publish("GetColumnsValues", ["UsrInactiveStatus"], [this.sandbox.id]) || {};
				return columnsValuesObject.UsrInactiveStatus;
			},
		},
		diff: /**SCHEMA_DIFF*/[]
		/**SCHEMA_DIFF*/
	};
});

4) Refresh the page and chek the result.

 

As a result in case the value for the UsrInactiveStatus column is false, the upload method will return an error popup stating that the current stage is inactive and uploading files is restricted. You can also check it by displaying the UsrInactiveStatus checkbox on the page and enabling\disabling it (an opportunity record must be saved each time you enable to disable the checkbox).

Show all comments

Hello Everyone,

I have a requirement to send a printable report in email. i have used "Printable attachments for Creatio | Creatio Marketplace " this Marketplace application of attaching printable reports but this is not work can anyone advice why?

Also, how to send this attached Printable in Email.

Like 0

Like

1 comments

Hello smit,

Feel free to email info@customerfx.com with the details of what is not working with the Printable Attachments for Creatio add-on? (I'm the author of that add-on). 

As far as attaching a printable to an email, that add-on does allow you to do that. You could also create a process that uses the Process File element to create the printable file, then a Send Email element to attach the file to an email. 

Ryan

Show all comments

Hello community!

I have a task to implement - that is to check if all the required files were uploaded in the attachments part of an opportunity record. My issue is that in the process it seems that I cannot find the Opportunity attachments object, so I can count the number of files. Why is that? Is there any other way to solve this?

 

Thank you!

Like 0

Like

2 comments

Hi, Maria!



I see the title of this object is 'File and link of opportunity'

 

Kind regards,

Vladimir

Thank you Vladimir,

I managed to find it as well. I thought it would be "Opportunity attachments", as it is for many other objects, but after a more thorough search I found it.

Show all comments

Hi Community,

 

I’ve this requirement where a specific user must run a specific Process. In this process, there should be a set of tasks that must gather all the attachments of the current record and generate a ZIP file with these attachments. Furthermore, this process should also download the ZIP file to the user’s computer.

 

Any idea on how can I achieve this requirement?

 

Thanks in advance.

 

Best Regards,

Pedro Pinheiro

Like 1

Like

4 comments

Hello Pedro,

Unfortunately, your task can not be achieved using the basic logic of Creatio. There is no possibility to generate ZIP files from attachments.

Also, you can not download some files to the user's computer automatically until he does not download them manually.

Best regards, Alex.

Hi there! We recently uploaded an application to the marketplace 
that allows you to download all the files of a section, example of an 
account, in a ZIP file. Possibly it is useful for your use case or 
to check how it was done. 
Check it here https://marketplace.creatio.com/app/download-zip-button-creatio

Thank you

Regards

Uriel,

 

Thank you for the response. We manage to find a solution for our requirement. However, If we get another use case like this one, we will have your application in mind.

 

Best Regards,

Pedro Pinheiro

 

Hi Pedro Pinheiro,

 

I am trying to achieve the same requirement . Would you be able to provide me the logic you used to create the zip and download it?. 

 

Best regards,

Pavan Manne

Show all comments

Hi Community,

 

I have to use Excel Export Creatio Functionality but instead of downloading the .xlsx file in the system, I have to attach that .xlsx file to the Attachments of a Custom Section.

This task should be performed by the business process after giving filtration criteria as input.

 

Please suggest me a solution to achieve the above task.

Like 1

Like

3 comments

Dear Pratik, 

 

Unfortunately requested functionality is not presented as OOB solution in Creatio at this moment. 

We will register this as an idea for the responsible R&D team to extend the basic functionality in future Creatio releases. 

 

Kind regards,

Roman

Hi Roman Brown,

Thanks for providing the information regarding to this.

 

But, for workaround is there any Creatio Service avaible that can be utilized In some custom script configuration with Script Task element of business process.?

And if yes, Is there any example available on how to make use of such Services in development. 

Hi Roman,

 

Could you please provide steps or source code for a sample excel sheet creation and saving data, that supports creatio platform (ex. using openXml, IronXL or Interop etc.) and later that can be extended with creatio's future release?

 

Regards,

Rishabh

Show all comments

Hello,

 

I am willing to add the attachments detail (available in Case page) to the Case Portal Page. I have created a replacing object on the BaseCase object and tried to add the following code to my client module: 

details: /**SCHEMA_DETAILS*/{
			"Files": {
				"schemaName": "FileDetailV2",
				"entitySchemaName": "CaseFile",
				"filter": {
					"detailColumn": "Case",
					"masterColumn": "Id"
				}
			}
		}/**SCHEMA_DETAILS*/,

and then added the following code on the diff:

diff: /**SCHEMA_DIFF*/[
{
				"operation": "insert",
				"name": "NotesFilesTab",
				"values": {
					"items": [],
					"caption": {
						"bindTo": "Resources.Strings.NotesFilesTabCaption"
					},
					"order": 2
				},
				"parentName": "Tabs",
				"propertyName": "tabs",
				"index": 3
			},
			{
				"operation": "insert",
				"name": "Files",
				"values": {
					"itemType": 2
				},
				"parentName": "NotesFilesTab",
				"propertyName": "items",
				"index": 0
			},
			{
				"operation": "insert",
				"name": "NotesControlGroup",
				"values": {
					"itemType": 15,
					"items": [],
					"caption": {
						"bindTo": "Resources.Strings.NotesGroupCaption"
					}
				},
				"parentName": "NotesFilesTab",
				"propertyName": "items",
				"index": 1
			},
			{
				"operation": "insert",
				"name": "Notes",
				"values": {
					"contentType": 4,
					"layout": {
						"column": 0,
						"row": 1,
						"colSpan": 24
					},
					"labelConfig": {
						"visible": false
					},
					"controlConfig": {
						"imageLoaded": {
							"bindTo": "insertImagesToNotes"
						},
						"images": {
							"bindTo": "NotesImagesCollection"
						}
					}
				},
				"parentName": "NotesControlGroup",
				"propertyName": "items",
				"index": 0
			},
			{
				"operation": "remove",
				"name": "Header"
			}
		]/**SCHEMA_DIFF*/,

but nothing is visible on the portal Case page.

 

Can you please help ?

 

Thank you

Like 0

Like

1 comments
Best reply

Hello,

 

You should add the same code to the replaced PortalCasePage module (not to the BaseCase object) and also don't forget to add localizable strings to the module.

 

Best regards,

Oscar

Hello,

 

You should add the same code to the replaced PortalCasePage module (not to the BaseCase object) and also don't forget to add localizable strings to the module.

 

Best regards,

Oscar

Show all comments

Hello community,

 

Does Creatio offer a way to track the download of a document from the Attachment and Notes section.

i.e Every time the user clicks on the download attachment button the system saves an audit of this action eg the person who downloaded it, time etc.

 

Best regards

Like 0

Like

3 comments

It can be done with development. I'll outline the parts you'd need to create/change (but it's all untested so you'll need to fill in any gaps).

First, you'd need to create a custom configuration service, we'll say it is call UsrCustomFileService that has a function GetFile that takes two params string entitySchemaUId, string fileId. All the function needs to do is something like this: 

[OperationContract]
[WebGet(UriTemplate = "GetFile/{entitySchemaUId}/{fileId}")]
public Stream GetFile(string entitySchemaUId, string fileId) {
    // log the user and file for entitySchemaUId and fileId here
    // now return the file calling the out of the box file service, something like this: 
    var fileService = new FileService();
    return fileService.GetFile(entitySchemaUId, fileId);
}

Then, you'll need to replace the FileDetailV2 schema and override the getColumnLinkConfig function. You could copy the existing function. Basically, what you'd need to change is to take the result of Terrasoft.FileDownloader.getFileLink(this.entitySchema.uId, id) and replace in that string "FileService" with the name of your custom configuration service "UsrCustomFileService". 

Now, when a link is clicked, the link will call your custom configuration service, which can log the download, then return the file stream so the file downloads.

Ryan

Hello,



We have developed file download logging for Contact section. Single package ready for install, but not so ready as Marketplace solution yet. 



Send PM or email to vs@aviterra.lv if you are interested in



Kind regards,

Vladimir

Vladimir Sokolov,

 



Would love to see it as a marketplace solution - definitely has some useful application here :)

Show all comments