Dear Community,

 

Is it possible to have a changelog as a detail?

We would like to see all the changes made to a field of an object visible in a list.

I assume that this list is being saved to an object as well?

 

Let's say that I create an entry in the Contact Change log to see whenever a name is changed, we can find this info through:

https://prnt.sc/zza09f

But it would be nice to see the list/data in a detail on the contact page itself.

 

Any help is appreciated, thank you!

 

 

Kind regards,

Yosef

 

Like 0

Like

2 comments

Dear Yosef, 



I guess that you can take a look at the following marketplace application which should cover your use case:

https://marketplace.creatio.com/app/change-log-creatio



Kind regards,

Roman

Dear Roman,

 

Thank you for this.

I installed it but it gave me an error... The only thing I need to know is where the info is being stored.

There should be a sys object somewhere?

 

Either way, thank you for the suggestion.

 

 

Kind regards,

Yosef

Show all comments

Dear, how can I see the code to create a database view? For example, I have a UsrVwContactAddress view and I would like to get the creation code for that view in sql console:

CREATE VIEW dbo.UsrVwContactAddress
AS
SELECT...

 

Thanks!

Like 0

Like

2 comments

Hi Sebastian, 

 

Here are the example how you can do it:

 

 

Best Regards, 

 

Bogdan L

If this is a cloud system, and you don't have access to local tools, you can use the following commands via SQL Executor to get the SQL for the view.

If database is MSSQL:

SELECT
    definition
FROM
    sys.sql_modules
WHERE
    object_id = object_id('viewname');

If database is Postgresql:

select pg_get_viewdef('"viewname"', true)

Ryan

Show all comments

Hi Team,

I couldn't find the SQL Console, which is a very useful tool in marketplace. Is it discontinued?

 

Like 1

Like

5 comments
Best reply

Krishna, 

In the mean time, if you have it in an existing system, you can export the package to install elsewhere.

Ryan 

Hello Krishna, 

 

The SQL Console add-on is currently being refined. Our Marketplace team will publish the application once it is done. Most likely it will become available in the next two weeks. 

 

Please, let us know in case any further information is required. 

 

Best regards,

Olga. 

Krishna, 

In the mean time, if you have it in an existing system, you can export the package to install elsewhere.

Ryan 

Ryan Farley,

Ryan, I was thinking so but was worried if it will work in latest 7.17 version. Have you tried it in new version?

I would recommend creating a trial app that will be 7.17 and installing the package with SQL-executor to it.

 

Best regards,

Oscar

Oscar Dylan,

Thanks Oscar, will try that.

Show all comments

Hello community,

 

We have a use case where Creatio co-exists with a legacy application which is SQL heavy - A lot of logic is written using SQL Stored procedures. There are certain custom objects on Creatio that needs to be populated and read by the legacy app on a weekly basis. Integration via APIs is not an option (owing to all the business logic being already available in Stored procedures). Using Excel Import/Export is also not an option. 



We are considering an ongoing ETL via SQL where a stored procedure is used to directly write/read info from Creatio's custom tables. Assume that the Legacy application has a good understanding of the schema and relationships and transformation/mapping to/from Creatio tables is not an issue. 



Pls comment on the following - 

1. Is this feasible? - In my view, this should definitely be feasible as at the end of the day, It is an SQL DB. Any data read out of Creatio's DB does not disturb the state of the data in the DB. Any data modified (correctly) in the DB should reflect correctly in the Creatio application. Can you confirm?

2. Is this recommended? - Apart from ease of use and need for SQL development, Are there any reasons from a Creatio product/architecture stand point why this might not be recommended? The load on the WebServer is a negligible factor as these SQL import/export will only be done during low usage periods weekly.



Thanks in advance!

Like 0

Like

8 comments
Best reply

Hello,

 

Thank you for your question!

Can you please check this Marketplace add-on, I believe it can help you with your business task.

But still, if you decide to use your approach, then:

1. Yes, that is feasible. The data will be available in the Application but you need to understand that if you miss to insert something, the data might be corrupted. Also, this kind if data transfer won't trigger BP as this will be considered to be direct data insert into the DB.

2. I can not say that this approach is recommended but it is possible. And again, you need to perform a lot of testing before real data transfer just not to lose data.

 

Best regards,

Bogdan S.

 

Hello,

 

Thank you for your question!

Can you please check this Marketplace add-on, I believe it can help you with your business task.

But still, if you decide to use your approach, then:

1. Yes, that is feasible. The data will be available in the Application but you need to understand that if you miss to insert something, the data might be corrupted. Also, this kind if data transfer won't trigger BP as this will be considered to be direct data insert into the DB.

2. I can not say that this approach is recommended but it is possible. And again, you need to perform a lot of testing before real data transfer just not to lose data.

 

Best regards,

Bogdan S.

 

Bogdan Spasibov,

Hi Bogdan. Appreciate your very clear answer. 



Yes, We did consider the plugin. But our use case needs to migrate data from a few custom SQL databases and on an ongoing ETL for 2 weeks.  Also, We mostly have custom objects on Creatio and it is not a typical Creatio CRM that we are building. 



#1 Yes, I understand that this won't trigger BPs. We are only doing this as a 1 time migration activity as our client is migrating an existing custom application to Creatio. 

Bogdan Spasibov,

HI Bogdan. Have a follow up question - 



We have workflows & business logic configured at the Application layer (Via business processes, entity event listeners & incoming API integrations). However, we need to transfer some data into our Database only via direct SQL. Is there any way at all of triggering application level logic on some Database level triggers?

 

I can think of a few round about/hacky ways of achieving this. Want some input wrt support for DB to Application layer execution flow from a Creatio product stand point and any clean ways of doing this. 

Bogdan Spasibov,

HI Bogdan. Have a follow up question - 



We have workflows & business logic configured at the Application layer (Via business processes, entity event listeners & incoming API integrations). However, we need to transfer some data into our Database only via direct SQL. Is there any way at all of triggering application level logic on some Database level triggers?

 

I can think of a few round about/hacky ways of achieving this. Want some input wrt support for DB to Application layer execution flow from a Creatio product stand point and any clean ways of doing this. 

M Shrikanth,

 

In case you need to interact with the database directly you need to use either stored procedures or triggers that could trigger additional actions upon some actions on the application level. This will be the easiest way to achieve your target.

 

Additionally there is a separate dbExecutor class that allows interacting with the database directly - https://academy.creatio.com/docs/developer/back-end_development/working….

 

 Please use one of these two options to achieve your business task.

 

Best regards,

Oscar

Oscar Dylan,

Hi Oscar. Thank you for the response. 



I was referring to use cases like the following - When a SQL Trigger gets activated, Run a business process at the Application layer. There is no direct way to do this I would presume?



Also, the dbExecutor class will help perform operations unidirectionally from the Application layer to the DB layer. I don't think something like this is available - When a trigger runs at the DB layer, it is available as an Event to catch or subscribe to at the Application layer. Is this right?



A very distant example would be something like this - 

https://stackoverflow.com/questions/3512026/how-can-i-execute-net-code-…

 

M Shrikanth,

 

Hello,

 

Yes, you are right, there is no way to call a business process execution using database triggers. You can call a business process to execute using ProcessEngineService.svc https://academy.creatio.com/docs/developer/front-end_development/creati… but this is the application layer.

 

You can call stored procedure using dbExecutor, but not visa versa (trigger calls a process). You can use another approach: insert data to the database and then call the process manually for all the records by their CreatedOn date value. As a result data will be inserted to the system and processed by a business process.

 

Best regards,

Oscar

Oscar Dylan,

Thank you Oscar for your response. Yes, the final approach you have suggested is one of the ways I also thought about. It is still round about and non optimal. Appreciate your answer nevertheless. 

Show all comments

Hi Community!

 

as there is no out-of-the-box way of deploying permissions from one system to another, I'm currently trying to achieve this via SQL.

 

I'm able to add a static SQL script to the package and it will be executed fine on the target system. My problem is that the content of the SQL script is not static. I have to execute an SQL script in the source system to get all the information about the current permission setup and then use these results to build the update/insert statements for the target system.

 

Did anyone try to accompish this before?

 

Thanks for any hints!

Like 0

Like

5 comments

Dear Robert,

 

Organization Roles can be transferred only by SQL scripts. Functional roles are transferred by binding data of the System administration object. The rights to existing records should be transferred via scripts as well. To distribute rights to new records you can either set up a business process or configure object permission directly on the production environment.

 

Best regards,

Angela

Angela Reyes writes:

Dear Robert,

Organization Roles can be transferred only by SQL scripts. Functional roles are transferred by binding data of the System administration object. The rights to existing records should be transferred via scripts as well. To distribute rights to new records you can either set up a business process or configure object permission directly on the production environment.

Best regards,

Angela

Thanks Angela!

 

But the question is how can I transfer the definition of the permissions, without rewriting the SQL script over and over again?

Is the following procedure the only way?

  1. Select the current permissions manually with SQL

    the tables are:

    1. SysEntitySchemaOperationRight for object permissions
    2. SysEntitySchemaRecordDefRight for record permissions
    3. SysEntitySchemaColumnRight for column permissions
  2. transform the result to and insert/update statement
  3. save those scripts in the package SQL section
  4. export/import package

And do I have to/am I allowed to truncate those 3 tables first?

Is there a stored procedure that applies the new permissions on the target systems' records?

 

Thanks a lot and best regards

Robert Pordes,

Your description is almost correct. Please see all steps:

1. Create scrip for update/ insert records from SysAdminUnit table to use these records in the next steps

2. Select the current permissions manually from SQL the tables:

2.1 SysEntitySchemaOperationRight for object permissions

2.2 SysEntitySchemaRecordDefRight for record permissions

2.3 SysEntitySchemaColumnRight for column permissions

2.4 Also there are tables like Sys{ObjectName}Right (e.g. SysAccountRight) in which record rights are stored, so you should create script for each object. 

3. Transform the result to and insert/update statement

4. save those scripts in the package SQL section

5. export/import package

 

Best regards,

Angela

Hi Angela,

thanks, but aren't the tables Sys{ObjectName}Right storing the applied rights (they will be populated by clicking "update record permissions", correct?). If I create scripts on eg DEV system, the data will not be the same! I mean we will definitely have different eg. account and contact records on dev/test/prod system.

That's exactly why I asked this in my previous post: 

Is there a stored procedure that applies the new permissions on the target systems' records?

 

Thanks,

Robert

Robert Pordes,

There is no stored procedure. This is why I suggested workarounds like

binding data and business processes.

 

Best regards,

Angela

Show all comments

One of our clients already has an extensive SQL server 2012 enterprise edition setup in place for their internal apps. They would like to continue using this for their Creatio instance as well. We are aware that Creatio supports 2012 SP 3 and higher. A few questions in this regard -

 

1. Would there be support for SQL Server 2012 in future versions of Creatio as well?

2. How easy/difficult is it to move from an older to a newer version of SQL Server in a working Creatio instance? 

Like 0

Like

6 comments

Hello,

 

1. We already do not recommend using SQL Server 2012 for onsite deployment and use 2016 version instead. 

2. It depends on the system administrator and server structure and many other variables that are hard to predict. 

 

Best regards,

Angela

Angela Reyes,

Hi Angela, 



Are there any known issues with Creatio on SQL 2012? The documentation says that Creatio is compatible with 2012 SP3 and higher. 

M Shrikanth,

There are no known issues so far. If needed you may stay on SQL 2012.

Angela Reyes,

Thank you very much Angela. Appreciate your response. Quick follow up question - 



Are there any known performance, security, availability or any other benefits at all, to Creatio using SQL 2016 instead of 2012? We want to understand if there are reasons why Creatio would recommend 2016. We would like to pass this on to our client to enable them to make a conscious choice to move to SQL 2016. 



We need high availability, redundancy and fail over and are going with a web farm environment on a private cloud. Also, We will be using the Machine learning service in Creatio. Let me know if this makes any difference to the SQL version choice. 

M Shrikanth,

We recommend SQL 2016 due to its own features that were implemented in that version, like security features, ect.

 

Best regards,

Angela

Angela Reyes,

Got it. Thank you Angela. So the Creatio application per say does not benefit from moving to SQL 2016. But owing to inherent advantages in SQL 2016, it is recommended. 

Show all comments

Hi,

I've this query and i would like to translate to ESQ, so far i managed to create this:

but i'm having this error: "uncaught exception: Collection item with name SysUserInRole not found".

I would like to know, why i'm getting this error? Is there a way to fix it? And if there is a better way to do that?

Best regards,

Pedro Pinheiro.

 

Like 0

Like

1 comments

Hi Pedro,



Seems like in your snippet you are setting brackets '[]' in wrong order. Systems tries to add column 'SysUserInRole' to the query which does not exist. I assume that you need to change it for the following:

esq.addColumn("=[SysUserInRole:SysUser].SysRole", "Role")



To make it more clear I have put together an example:

 

var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
					rootSchemaName: "SysAdminUnit"
				});
 
				esq.addColumn("Name");
				esq.addColumn("Contact.Name");
				esq.addColumn("=[SysUserInRole:SysRole].SysUser");
 
				var currentUserFilter = this.Terrasoft.createColumnFilterWithParameter(
						this.Terrasoft.ComparisonType.EQUAL,
						"=[SysUserInRole:SysRole].SysUser",
						Terrasoft.SysValue.CURRENT_USER.value);
 
				esq.filters.addItem(currentUserFilter);
 
				esq.getEntityCollection(function(response) {
					debugger;
				}, this);

This example generates following sql query:

 

exec sp_executesql N'
SELECT
	[SysAdminUnit].[Id] [Id],
	[SysAdminUnit].[Name] [Name],
	[Contact].[Name] [Contact.Name],
	[SysUserInRole].[SysUserId] [SysUserInRole.SysUserId],
	[SysUser].[Name] [SysUser.Name]
FROM
	[dbo].[SysAdminUnit] [SysAdminUnit] WITH(NOLOCK)
	LEFT OUTER JOIN [dbo].[Contact] [Contact] WITH(NOLOCK) ON ([Contact].[Id] = [SysAdminUnit].[ContactId])
	LEFT OUTER JOIN [dbo].[SysUserInRole] [SysUserInRole] WITH(NOLOCK) ON ([SysUserInRole].[SysRoleId] = [SysAdminUnit].[Id])
	LEFT OUTER JOIN [dbo].[SysAdminUnit] [SysUser] WITH(NOLOCK) ON ([SysUser].[Id] = [SysUserInRole].[SysUserId])
WHERE
	[SysUserInRole].[SysUserId] = @P1',N'@P1 uniqueidentifier',@P1='7F3B869F-34F3-4F20-AB4D-7480A5FDF647'

Hope it helps!



Regards,

Dmytro

Show all comments

Hello,

Dear community, 

I've one question : 

Can you tell me the SQL request in order to list the duplicated contacts, and the duplicated account. 

I've tried with the generate db structure and asked the several tables but there is nothing which is done. 

 

Can you help me ? 

 

Thanks in advance, 

Best regards 

Like 0

Like

1 comments

Hello Rocher,

This query is based on which field you are using to determine if the contact is duplicate or not. Here is an example of contact duplicates search result via SQL-query by contact name:

select Name, count (Name) Amount from Contact

group by Name

having count (Name) > 1

Best regards,

Oscar

Show all comments



Hi community!



Contact has a colmn called "ContactPhoto" which returns System.Byte[].

I need this to be a string for a view that I'm creating.



this is what I tried:

 

SELECT Id, ContactPhoto,
	cast('' as xml).value('xs:base64Binary(sql:column("ct.ContactPhoto"))', 
	'varchar(max)') AS UsrContactPhoto
	FROM contact ct

which returns me an empty string:

https://prnt.sc/po1qe8

 

Any idea how I can convert it?



Thanks in advance!

File attachments
Like 0

Like

0 comments
Show all comments

Hi,

I'm currently trying to obtain the "Id" from one of the contacts in my "Contact" table but I'm getting the same error:

Terrasoft.Common.ItemNotFoundException: Value "Id" was not found.

   at Terrasoft.Core.Entities.EntityColumnValueCollection.GetByName(String name)

   at Terrasoft.Core.Entities.Entity.InternalGetColumnValue(String valueName)

   at Terrasoft.Core.Entities.Entity.GetColumnValue(String valueName)

   at Terrasoft.Core.Process.UsrProcess2MethodsWrapper.ScriptTask1Execute(ProcessExecutingContext context)

   at Terrasoft.Core.Process.ProcessScriptTask.InternalExecute(ProcessExecutingContext context)

   at Terrasoft.Core.Process.ProcessFlowElement.Execute(ProcessExecutingContext context)

 

This is the script task i'm using for it:

var result = "";

var userConnection = Get("UserConnection");

    

EntitySchemaManager esqManager = userConnection.EntitySchemaManager;

var rootEntitySchema = esqManager.GetInstanceByName("Contact") as EntitySchema;

var esqResult = new EntitySchemaQuery(rootEntitySchema);

esqResult.AddColumn("Id");

esqResult.AddColumn("Name");

var entities = esqResult.GetEntityCollection(UserConnection);

result = entities[0].GetColumnValue("Id").ToString();



Set("ProcessSchemaParameter1", result);

return true;

Note: If i try to get the "Name" instead i dont get any error.

Like 0

Like

1 comments

Try this

var opportunityCarQuery = new EntitySchemaQuery(UserConnection.EntitySchemaManager,"OpportunityCar");
opportunityCarQuery.AddAllSchemaColumns();
 
var filter = opportunityCarQuery.CreateFilterWithParameters(FilterComparisonType.Equal, "Car", (Guid)carNodeId);
opportunityCarQuery.Filters.Add(filter);
 
var opportunityCarEntities = opportunityCarQuery.GetEntityCollection(UserConnection);
 
foreach (var opportunityCarEntity in opportunityCarEntities)
{
	var theId = opportunityCarEntity.GetTypedColumnValue<Guid>("Id");
}

 

Show all comments