I need to invoke Creatio Rest API from a Business Process to take advantage of out-of-the-box functions available via Creatio API.

For example I need to create a copy of a given Project. I saw that the "copy" button of the user interface invoke this endopint: /0/rest/ProjectUtilitiesService/CopyProjectWithStructure

The payload is like {"projectId": "54df197d-7708-4c6d-8dea-778465bec49d"}.

The response is like {"errorInfo":null,"success":true,"nextPrcElReady":false,"queryId":null,"responseStatus":null,"rowsAffected":-1,"CreatedProjectId":"0198cd7d-75b4-4924-8b06-49e2acbcb8cf"}

I need to do the same thing of the "copy button" inside a business process so I configured a web service (standard Web Service section) setting the endpoint and Basic Authentication (Supervisor username with its password set in custom system settings).

When I try the web service I get an "Unauthorized" response:

How should the web service be set to be used "from Creatio to Creatio"?

Is there a better way to reach the same goal from Business Processes?

 

Thanks

Like 1

Like

2 comments
Best reply

Have you tried just calling the classes directly as classes? There's no need to call as a service since it's just a C# class that you can call directly. Or bypass the ProjectUtilitiesService, which is just a service wrapper around ProjectCopyManager and try calling that instead.

Something like (not tested):

var copyManager = new ProjectCopyManager(UserConnection);
copyManager.CopyProjectWithStructure(projectId);

Ryan

Have you tried just calling the classes directly as classes? There's no need to call as a service since it's just a C# class that you can call directly. Or bypass the ProjectUtilitiesService, which is just a service wrapper around ProjectCopyManager and try calling that instead.

Something like (not tested):

var copyManager = new ProjectCopyManager(UserConnection);
copyManager.CopyProjectWithStructure(projectId);

Ryan

Ryan Farley,

Thanks Ryan, it works; here's my code inside a script task:

var copyManager = new Terrasoft.Configuration.ProjectCopyManager(UserConnection);
Guid newProjectId = copyManager.CopyProjectWithStructure(projectId);

 

Show all comments

 Hi community,

I'm trying to disable the columns of an editable detail to make them read only and I have read many articles about it, but I'm still having a problem that I can't fix.



I wrote this code in the GridDetail to disable the fields but I noticed that for some of the columns of the detail is not working.

getCellControlsConfig: function(entitySchemaColumn) {
    if (!entitySchemaColumn) {
        return;
    }
    var columnName = entitySchemaColumn.name;
    var enabled = (entitySchemaColumn.usageType !== this.Terrasoft.EntitySchemaColumnUsageType.None) &&
        !this.Ext.Array.contains(this.systemColumns, columnName);
    var config = {
        itemType: this.Terrasoft.ViewItemType.MODEL_ITEM,
        name: columnName,
        labelConfig: {visible: false},
        caption: entitySchemaColumn.caption,
        enabled: enabled
    };
    if (!this.values.IsEnabled) {
        config.enabled = false;
        //config.labelConfig.enabled = false;
        //this.set("Is"+columnName+"enabled", false);
    }
    if (entitySchemaColumn.dataValueType === this.Terrasoft.DataValueType.LOOKUP) {
        config.showValueAsLink = false;
    }
    if (entitySchemaColumn.dataValueType !== this.Terrasoft.DataValueType.DATE_TIME &&
        entitySchemaColumn.dataValueType !== this.Terrasoft.DataValueType.BOOLEAN) {
        config.focused = {"bindTo": "Is" + columnName + "Focused"};
    }
    console.log(config);
    return config;
},

Debugging I have discovered that the detail adds to the labelConfig the property "enabled" which is binded to an attribute ("isProductenabled").

I tried to force the property writing it in the method and I also tried to set the attribute manually, but it's not working... do you have any idea?



Let me know.

Thanks in advance.



Best regards,

Luca

Like 0

Like

5 comments
Best reply

Luca Tavasanis,

While I was debugging I have noticed that the properties of the labelConfig that enabled some of the fields where added in the method: "applyBusinessRulesForActiveRow: function(id, gridLayoutItems)" and to fix the issue I just added this method in the client module.

You can lock the fields in the editable detail using business rules on the page for the detail, rather than in code. On the page for the detail, add a business rule to make the field not editable. Something like 

Condition: Boolean true = Boolean false (something that is never true)

Then: Make field editable (the condition is never true, so field is never editable)

The business rule will apply to the detail list and the fields will not be editable in the detail list.

Ryan

Hi Ryan,

I'm actually working with the BaseGridDetail so I can't lock it with a business rule... do you have any other idea?

 

Thanks anyway.

Luca

Luca Tavasanis,

IIRC to do it in code I usually do it like this (but unable to verify if this is correct at the moment)

getCellControlsConfig: function(entitySchemaColumn) {
    // get config from base 
    var config = this.mixins.ConfigurationGridUtilities.getCellControlsConfig.apply(this, arguments);
    var columnName = entitySchemaColumn.name;
 
    // if this is the column I want to disable
    if (columnName === "UsrMyColumn") {
        Ext.apply(config, {
            enabled: false
        });
    }
 
    return config;
}

Hopefully that gets you closer, of course, if you're wanting to disable all, you could just remove the if to check the column it's for.

Ryan

Ryan Farley,

I just tried what you suggested but unfortunately it's not working... it returns an error when I use this.callParent(arguments);.

Thank you anyway.



Luca

Luca Tavasanis,

While I was debugging I have noticed that the properties of the labelConfig that enabled some of the fields where added in the method: "applyBusinessRulesForActiveRow: function(id, gridLayoutItems)" and to fix the issue I just added this method in the client module.

Show all comments

Hi,



We would like to deactivate "New Order" in opportunities, we deactivated all the processes related to orders but it is still generating.



Any idea ?



(7.18.5)

Like 0

Like

3 comments
Best reply

Hi Damien,



If you want to deactivate button 'New order', you can add this code in diff of OpportunityPageV2:



            {

                "operation": "remove",

                "name": "CreateOrderFromOpportunityButton"

            }



 

Hello Damien,

 

Your business task could be achieved only by delelopment.

 

Please refer to the post by the link below:

https://community.creatio.com/questions/hide-button-opportunity-edit-pa…



Best regards,

Bogdan

Hi Damien,



If you want to deactivate button 'New order', you can add this code in diff of OpportunityPageV2:



            {

                "operation": "remove",

                "name": "CreateOrderFromOpportunityButton"

            }



 

Vladimir Sokolov,

 



Thanks a lot, worked like a charm :)

Show all comments

Hi community,

I'm trying to read the value of a custom system setting in creatio from the client-side, but I noticed that even if my setting has the flag "Cached" it results undefined when I try to get the value using this code:

var test = Terrasoft.SysSettings.cachedSettings.UsrSysSettingTest;





while when I use the asynchronous way it works fine.

Code for the asynchronous way:

Terrasoft.SysSettings.querySysSettingsItem("UsrSysSettingTest", function(sysSettingTest) { 

       var test = sysSettingTest; //here is defined

}, this);



Do you know why this is happening?

 

Let me know.

Thanks in advance,

Luca

Like 0

Like

5 comments
Best reply

Hi everyone,

I discovered that the problem with the cached setting was the type of it. To fix the issue I simply had to change the type from Text (500) to Text (250), I tried to do the same in other environments and I had the same result.

Hope it can help.

 

Best regards,

Luca

Hi Luca,

 

I was able to reproduce this behavior using the following steps:

 

1) Create a system setting

2) Don't relogin to the app and execute both commands you've shared in the developer console

 

As a result synchronous call returns undefined, async call returns value.

 

You need to relogin to the app to start using the setting value synchronously (if it won't help try flushing Redis).

 

Best regards,

Oscar

Hi Oscar,

I've actually logged into the app many times, I even closed the browser and flushed Redis, but I still have this issue.

 

Is there anything else I can do?

Thanks.

 

Best regards,

Luca

Luca Tavasanis,

 

Does this issue occur in another browser? In my case cached system setting was fetched properly after relogin and the issue is not in the rights for the setting since you can fetch it asynchronously.

 

Best regards,

Oscar

Oscar Dylan,

Yes, I have this problem also in other browsers.

 

Best regards,

Luca

Hi everyone,

I discovered that the problem with the cached setting was the type of it. To fix the issue I simply had to change the type from Text (500) to Text (250), I tried to do the same in other environments and I had the same result.

Hope it can help.

 

Best regards,

Luca

Show all comments

Hi Colleagues! How are you?

I'm trying to develop a kind of webhook on Creatio. To achieve it I have created an anonymous web service. The issue I'm experiencing is a Bad Request 400 when receiving the request that is going to be sent by third party app. They are going to send an XML using  POST request, Content-Type = text/xml, and XML Body similar to this one:

<?xml version="1.0" encoding="ISO-8859-1"?>

 

 

If i change the encoding for example to UTF-8 it works.

I tried a lot of alternatives but always I get the same result:

  1. Changing the service contract,
  2. Operation contract,
  3. Mapping a custom class,
  4. Override WebContentTypeMapper

 

Any recommendation? Any workaround?

Appreciate it!

Regards.

Like 0

Like

2 comments

can you post the code?

keith schmitt,

How are you? Thank you your interest. As I commented I tried a lot of alternatives. Attached the code. Focus on UpdateSMSStatus / 

GetInstructions / ProfileRequest. Each method has a different behavior but none of them works.

 

https://drive.google.com/file/d/1Q1cIxIN7GCUT-DsEJCHT2IKr1R39DkKL/view



Thank you!

Show all comments

Hi, 

 

I'd like to set permission for add-on (installed application). 

 

Anyone can help how can I do it please

 

Thanks

Like 0

Like

3 comments

Hello Minh,

 

It depends on the MarketPlace add-on. Let me explain to you on the SQL Executor for Creatio add-on:



In order to set permission rules you need to go to ‘System Designer’, click on ‘Operation permissions’, and select operation named ‘Access to ‘SQL Console Requests section’ (the code is CanUseSqlConsole).  

Having it done you can add or delete access rights for users and groups of users.

 

Right after you complete making these settings, please make logout and login into your account again.

 

Best regards,

Bogdan

Hi Bogdan,

 

Thank you for your reply,

But I cannot find operation 'Access to' SQL Console Requests section, please see picture

Can I add new operation permission and link it to an addon?

 

Kind Regards, 

 

Minh,

 

This operation permission shoud be created automatically after add-on installation. 



Please try to create it manually, if it wasn't created automatically.

 

Best regards,

Bogdan

Show all comments

We implemented an approval process in the opportunity entity.

But now I have the requirement to link the approval-records also with an second entity.

 

In the new approval-object (which will created if you activate the approval in the target section wizard), I created a new lookup-field (link to the second entity).

 

 

But in the Approval task I can't find any way to fill this new field.

 

 

Is there any solution for this requirement?

Like 0

Like

1 comments

I believe its best to use only one record in the system to be linked to the Approval. You just have to ask yourself what the user is accuallt approving and commit to that. Is it the Opportunity(aka Pitch?) or the Project(aka Matter?)?

 

If I wanted to display History of Approvals of the Opportunity, on the Project Page, that's easy to set up using a Detail. Easy to use and good overview as well

 

You could modify the Approval object and have it be connected to an Project (this not the same as the Link-function since that's pretty special). But I gotta wonder if this is neccessary

Show all comments

Hi community,

 

How do you make a link (string field) a hyperlink in a mini-page? It is displayed as a label (https://academy.creatio.com/api/jscoreapi/7.15.0/index.html#!/api/Terra…) but there is no "showValueAsLink" property like in a text field in a page.



And how can I create a field that has the same behaviour as the email field in the default contact page? I have a "linkedin" field that I need to sync with the communication option (which has a linkedin field added under "website") and I need to sync it with the same behaviour as the email field (which takes the main email in the communication option, automatically adds a new email or updates it etc.).

 

Best regards,

 

Julien

Like 0

Like

7 comments

Hi Julien,

 

As for your first question - it's not clear which string-link field on the mini page you are refering to. I hope this community post where a similar question was asked will be useful - https://community.creatio.com/questions/convert-text-field-hyperlink.

 

As for your second question - the logic behind the email column is stored in the BaseCommunication and ContactCommunication objects in the Base package (processes on these objects). You need to study how the logic is declared there.

 

Best regards,

Oscar

Oscar Dylan,

 

Thank you for your answer, about my first question I mean a mini page that shows when you hover on a record :

 

I need to change a field that shows on the minipage to a link (with target _blank). On a page directly I can use a "ShowAsLink" attribute, but the component on a minipage that shows a text field is a label, which don't have a "ShowAsLink" attribute.

 

Thank you for your answer on the second question, I'll dig into the Base Package.

 

Best regards,

 

Julien Gunther

Julien Gunther,

 

This minipage is a "view" type minipage for the section that is used as a lookup reference. So you need to create the same logic described in the community post I shared above for the field on that minipage.

 

Best regards,

Oscar

Oscar Dylan,

 

The text field is rendered as a label, and it throw me this error :

Uncaught Object { message: "Property showValueAsLink is not defined in class Terrasoft.controls.Label" }

 

here is my diff :

			{
				"operation": "insert",
				"name": "Linkedin889ba056-f389-4852-a0f2-b5f8caede729",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 10,
						"layoutName": "MiniPage"
					},
					"isMiniPageModelItem": true,
					"visible": {
						"bindTo": "isViewMode"
					},
					"bindTo": "Linkedin",
					"showValueAsLink": true,
					"controlConfig": {
						"enabled": true,
						"href": {
							"bindTo": "getLinkedin"
						},
						"linkclick": {
							"bindTo": "onExternalLinkClick"
						}
					}
				},
				"parentName": "MiniPage",
				"propertyName": "items",
				"index": 13
			},

and the methods :

		methods: {
			getLinkedin: function() {
				return this.getLink(this.get("Linkedin"));
			},
			onExternalLinkClick: function() {
				return;
			},
			getLink: function(value) {
				if (Terrasoft.isUrl(value)) {
					return {
						url: value,
						caption: value
					}
				}
			}
		},

Best regards,

 

Julien Gunther

Julien Gunther,

 

Ok, we can do it in another way. We can create a virtual column, populate it with the value from the main record and display it not as a label in the minipage, but as a string field. For example using the code below (was added to the ContactMiniPage in my case):

define("ContactMiniPage", [], function() {
	return {
		entitySchemaName: "Contact",
		attributes: {
			"LinkedIn": {
				"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
				"value": ""
			}
		},
		modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		methods: {
			onEntityInitialized: function() {
				this.callParent(arguments);
				var linkedInValue = this.get("UsrLinkedIn");
				this.set("LinkedIn", linkedInValue);
			},
			getLinkedInLink: function() {
				return this.getLink(this.get("LinkedIn"));
			},
			getLink: function(value) {
				if (Terrasoft.isUrl(value)) {
					return {
						url: value,
						caption: value
					};
				}
			},
			onLinkedInLinkClick: function() {
				return;
			},
		},
		dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
		diff: /**SCHEMA_DIFF*/[
			{
				"operation": "insert",
				"name": "LinkedIn",
				"values": {
					"showValueAsLink": true,
					"controlConfig": {
						"href": {
							"bindTo": "getLinkedInLink"
						},
						"linkclick": {
							"bindTo": "onLinkedInLinkClick"
						}
					},
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 11
					},
					"caption": {
						"bindTo": "Resources.Strings.LinkedIn"
					},
					"bindTo": "LinkedIn",
				},
				"parentName": "MiniPage",
				"propertyName": "items",
				"index": 5
			},
			{
				"operation": "merge",
				"name": "HeaderContainer",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 0
					}
				}
			},
			{
				"operation": "merge",
				"name": "TimezoneMiniContactPage",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 9
					}
				}
			},
			{
				"operation": "merge",
				"name": "JobInfoContainer",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 10
					}
				}
			},
			{
				"operation": "move",
				"name": "JobInfoContainer",
				"parentName": "MiniPage",
				"propertyName": "items",
				"index": 2
			},
			{
				"operation": "merge",
				"name": "Name",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 1
					}
				}
			},
			{
				"operation": "merge",
				"name": "Type",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 2
					}
				}
			},
			{
				"operation": "merge",
				"name": "Account",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 3
					}
				}
			},
			{
				"operation": "merge",
				"name": "JobTitle",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 4
					}
				}
			},
			{
				"operation": "merge",
				"name": "Department",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 5
					}
				}
			},
			{
				"operation": "merge",
				"name": "MobilePhone",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 6
					}
				}
			},
			{
				"operation": "merge",
				"name": "Email",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 7
					}
				}
			},
			{
				"operation": "remove",
				"name": "OwnerEdit"
			},
			{
				"operation": "remove",
				"name": "Owner"
			},
			{
				"operation": "remove",
				"name": "OwnerButtonContainer"
			},
			{
				"operation": "remove",
				"name": "OwnerCallButton"
			},
			{
				"operation": "remove",
				"name": "OwnerEmailButton"
			}
		]/**SCHEMA_DIFF*/
	};
});

As a result I received a clickable linkedin field in the view-minipage:

Hope it will work in your case as well.

 

Best regards,

Oscar

Oscar Dylan,

 

I still have the same error :

Uncaught Object { message: "Propriété showValueAsLink is not defined in class Terrasoft.controls.Label" }

 

Here is my code :

define("MTF_Candidat1MiniPage", [], function() {
	return {
		entitySchemaName: "MTF_Candidat",
		attributes: {
			"LinkedinVirtual": {
				"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
				"value": ""
			}
		},
		modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		methods: {
			onEntityInitialized: function() {
				this.callParent(arguments);
				this.set("LinkedinVirtual", this.get("UsrLinkedin"))
			},
			getLinkedinLink: function() {
				return this.getLink(this.get("LinkedinVirtual"));
			},
			onExternalLinkClick: function() {
				return;
			},
			getLink: function(value) {
				if (Terrasoft.isUrl(value)) {
					return {
						url: value,
						caption: value
					}
				}
			}
		},
		dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
		diff: /**SCHEMA_DIFF*/[
			// other items in diff ....
			{
				"operation": "insert",
				"name": "Linkedin889ba056-f389-4852-a0f2-b5f8caede729",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 10,
						"layoutName": "MiniPage"
					},
					"caption": "Linkedin",
					"isMiniPageModelItem": true,
					"bindTo": "LinkedinVirtual",
					"showValueAsLink": true,
					"controlConfig": {
						"href": {
							"bindTo": "getLinkedinLink"
						},
						"linkclick": {
							"bindTo": "onExternalLinkClick"
						}
					}
				},
				"parentName": "MiniPage",
				"propertyName": "items",
				"index": 39
			}
		]/**SCHEMA_DIFF*/
	};
});

"isMiniPageModelItem" is a required attribute, if set to false or removed it raise this error:

Uncaught Object { message: "DataValueType.null is not supported" }

 

Do you have another solution ?

 

Best regards,

 

Julien

 

 

Julien Gunther,

 

Your error comes from some place that is not present in the code I shared. Everything is working on my end, please perform an absolutely same setup.

 

Best regards,

Oscar

Show all comments

Hello,

when you send emails from creatio the sender is always shown at the top of the record (here John Best):

it would make more sense, if the recipients of the emails were shown at this place.

Is that possible?

 

For incoming emails that is fine but for outgoing email it would be better to show the recipients here.

 

BR

Like 0

Like

1 comments

Hello,

 

I've created a logic that will display recipients specified in the "To" field of the email. Here is how it looks like on my end:

To achieve this I've performed the following steps:

 

1) Created a replacing view module in configurations and selected EmailItemSchema as a parent module:

2) Added the following code there (the implementation was created using the email body as an analog):

define("EmailItemSchema", ["BusinessRuleModule", "EmailConstants"], function(BusinessRuleModule, EmailConstants) {
	return {
		entitySchemaName: EmailConstants.entitySchemaName,
		methods: {
			getRecipients: function() {
				var recipientsList = this.get("Recepient");
				return "Recipients: " + recipientsList;
			}
		},
		diff: /**SCHEMA_DIFF*/[
			{
				"operation": "insert",
				"name": "RecipientsContainer",
				"parentName": "EmailMessage",
				"propertyName": "items",
				"values": {
					"itemType": Terrasoft.ViewItemType.CONTAINER,
					"items": []
				}
			},
			{
				"operation": "insert",
				"parentName": "RecipientsContainer",
				"propertyName": "items",
				"name": "RecipientsText",
				"values": {
					"itemType": Terrasoft.ViewItemType.LABEL,
					"caption": {bindTo: "getRecipients"},
					"classes": {
						"labelClass": ["message-email-text"]
					},
				}
			},
		]/**SCHEMA_DIFF*/,
		rules: {}
	};
});

3) Refresh the page

 

You can use the example above to develop your own logic if needed.

 

Best regards,

Oscar

Show all comments

How can I set up B2B2C hierarchy in CRM, think of it as a franchise based business where each franchise has its own employees, customers/leads/accounts/deals etc. Franchise employees can login and manage their leads, contacts and deals and we at the top of hierarchy can see all franchises and aggregated the data. Does Creatio CRM supports this by default and if not then can we customize and supports it. We need this B2B2C hierarchy  for all marketing, sales and service. Please suggest.

 

Like 0

Like

4 comments

Hello Gaurav,

 

Unfortunately, our platform does not have any presents for such projects.

Although, it is possible to achieve such configuration by setting up roles and distributing the access to the system between your customers.



For example: You can branch out the access in the way that only certain users will full access to all the data on your instance while "franchises" will be able to access the information only related to them.

 

Thank you,

Artem.

Artem,

Thanks for providing that information, but what is going to be name of entity/object which will represent a Franchise/Partner in creation CRM, I can see Partnerships, Accounts etc but not sure it can be used to represents a franchise or not. Also can we achieve the flexibility of assigning a lead, deal to a user where dropdown will only show the users/employees of that franchise not all users in system. We can filter by franchise, means can see all leads, contacts, deals etc for each franchise and so on. Can we customize the Creation CRM which means all sales, marketing and service to this much extent or its too much to do, I mean adding new tables/entities or columns in user tables etc. Please suggest.

Take a Look at this franchise management app developed on Creatio CRM. Here is the link: https://marketplace.creatio.com/app/franchise-management-creatio

Harold Busby,

Thanks for providing that link, I have installed this app but not sure what is entity for franchise in this app, can you please share some link to its documentation so that I can understand it.

Show all comments