Hi 

Have created stored proc through sql script but it was failed when trying to install. Considering SQL script execution is passed, will those SQL scripts be created in database, shall we assume that  each business will have separate database in Creatio?

Like 0

Like

4 comments

Hello,
 

With which error, the installation of the script failed?

Hi, I am using SQL script in MSSQL. Please find my script below for creating Proc. 'UsrMemberData' is the object which i created in my app.

 

IF OBJECT_ID('UsrMemberData', 'P') IS NOT NULL BEGIN
   DROP Procedure UsrMemberData;
END
GO

CREATE Procedure UsrMemberData 
Begin
    SELECT * FROM UsrMemberData
End

 

It shows below error


Is SQL Script is working ony for any specific DBMS type? Can you please let me know how to work out this .

 

Thanks!

 

 

Hello,

 

The issue is likely due to the case sensitivity of SQL Server keywords and the positioning of the GO statement. Here’s the corrected script with proper syntax:

IF OBJECT_ID('UsrMemberData', 'P') IS NOT NULL 
BEGIN
   DROP PROCEDURE UsrMemberData;
END
GO

CREATE PROCEDURE UsrMemberData 
AS
BEGIN
   SELECT * FROM UsrMemberData; -- Assuming UsrMemberData is a table
END
GO
 

Hi,

Have tried with above code but still got the issue

 

Please find the script below,

 

IF OBJECT_ID('UsrMemberDataRetrieve', 'P') IS NOT NULL 
BEGIN
  DROP PROCEDURE UsrMemberDataRetrieve;
END
GO

CREATE PROCEDURE UsrMemberDataRetrieve 
AS
BEGIN
  SELECT * FROM UsrMemberDetailsData; 
END
GO

 

Can you please let me know sql script is compatible with any specific DBMS type. Thanks!

 

 

 

 

 

 

Show all comments

Hi Community,

Have used the objects inside the SQL scripts for creating views and try to install it,but the installation failing in creatio with the error "No such object found" . Is there any specific way to define objects inside the SQL scripts ? Is SQL script execution process is missing in CRM ? 

 

Thanks in advance!

 

Like 0

Like

4 comments

Hi, that's the correct way to do it. Are you using SQL or Postgres?  Do you want to share the create view script you are using? 

Best regards!

Hi, I am using SQL script. Please find my script below for creating view.

'UsrShow' is the object which i created in my app.

 

IF OBJECT_ID('UsrShow', 'V') IS NOT NULL BEGIN
    DROP VIEW UsrShow;
END
GO

CREATE VIEW UsrShow (
        Id,
        Name
    ) AS
SELECT
    NEWID() [Id],
    UsrShow.Name
FROM UsrShow

 

It shows below error

 

I donno what i am missing here.  Is there anything to set to the object when calling it in view ? Can you please let me know how to work out this.

 

Thanks!

Paviyathachayini Mahendran,

 

Hello!

 

You receive a PostgreSQL exception upon executing a query written for MS SQL. You need to rewrite your query to be used in PostgreSQL.

Hi,

Thank You for the quick response. When i tried a script in PostgreSql it gets installed successfully. But could you please let me how to use this script or stored procedure inside the creatio application  ? like pulling data in a report based on the Stored procedure execution results ..

Show all comments

I changed the SQL Server Authentication settings to Windows Authentication Mode. But when I login to Creatio I get a Login Failed error.

What do I need to set in the Connection String?

 

Like 0

Like

1 comments

I want to update MaxFileSize and ActiveFileContentStorage using a query to save time. But whenever I tried to run the query from SQL Console it successfully update the values in the database but they are not reflected in the Creatio Portal.

 

When I add the query in the SQL file in advanced settings and run it, it updates the data in the database and in the portal as well. The problem is that it's not dynamic which will kill the purpose of using the query.

 

In other words, if I have to go and change the value in that file and run it again then we can do the same for the system settings as well.

 

Can anyone help me with that?

 

Thanks in advance.

Like 0

Like

1 comments

Hello Syed,

 

The issue here is that these values are also storred in cache and direct updating of these values are not reflected in the cache. That's why you have old values after updating values from the database directly.

 

What should be done after updating values in the database is Redis flush. But this will lead to all users to be logged out from the system and obviously cannot be performed during business hours for the application (or users should be notified that the Redis will be flushed soon). After Redis flush new system settings values will be used when working in the application.

Show all comments

Hi all, 



I am trying to figure out, how do we connect Creatio directly to another (webapp's/app) SQL database which is not the Creatio one, without needing to pass through an API.

 

If we keep it simple, Pipedrive, they are able to provide SQL connections through Zapier, with triggers on both sides (if a change in Pipedrive --> add a column in the other SQL db OR if column added in SQL DB, do x action in Pipedrive). https://zapier.com/apps/pipedrive/integrations/sql-server 



How do we replicate such direct (bi-directional) integration with Creatio and another sql db without the need for the other web app to expose or call an API ?



Cheers, 



Damien

Like 2

Like

1 comments

Hi Damien,

If I understood your question correctly, I recommend you look at this discussion.

As described there, the most suitable solution, in this case, is a business process.

Show all comments

Hello Creatio Community,

This happens in the Application Section. When i fill in the product terms and try to save the Application this pop up is shown. Meanwhile the object SysFinApplicationSpecRight doesnt exist at all in the database. How can I fix this problem ?

Regards

Like 0

Like

2 comments

Printscreen of Error Logs

 

Managed to solve the problem by re-compiling FinApplicationSpec

Show all comments

Hi community,

 

I'm working on a new view object to create custom dasboards for my customer based on Bulk Email stats. I noticed that Creatio has an OOTB View object called "VwBulkEmailAudience" which is based on "BulkEmailTarget", "BETArchiveFirstGeneration" and "BETArchiveSecondGeneration".

Does anybody knows what the least two tables are used for? I have checked both the local-dev and the production site, and those tables are empty.

I enclose the script for the OOTB View in case you'd like to gain a better understanding of what I'm talking about.

 

Thank you in advance guys and girls! Have a nice day :)

-- View: public."VwBulkEmailAudience"
 
-- DROP VIEW public."VwBulkEmailAudience";
 
CREATE OR REPLACE VIEW public."VwBulkEmailAudience" AS
 SELECT "BET"."MandrillId" AS "Id",
    "BET"."CreatedOn",
    "BET"."ModifiedOn",
    "BET"."BulkEmailId",
    "BET"."ContactId",
    "BET"."EmailAddress",
    "BERR"."DCReplicaId" AS "ReplicaId",
    "BET"."LinkedEntityId",
    "BET"."BulkEmailResponseId",
    "BET"."Clicks",
    "BET"."Opens",
    "BET"."ProviderName",
    NULL::text AS "SessionId",
    0 AS "IsSent"
   FROM "BulkEmailTarget" "BET"
     LEFT JOIN "BulkEmailRecipientReplica" "BERR" ON "BERR"."RecipientId" = "BET"."MandrillId"
UNION ALL
 SELECT "FG"."MandrillId" AS "Id",
    "FG"."CreatedOn",
    "FG"."ModifiedOn",
    "FG"."BulkEmailId",
    "FG"."ContactId",
    "FG"."EmailAddress",
    "BERR"."DCReplicaId" AS "ReplicaId",
    "FG"."LinkedEntityId",
    "FG"."BulkEmailResponseId",
    "FG"."Clicks",
    "FG"."Opens",
    "FG"."ProviderName",
    NULL::text AS "SessionId",
    0 AS "IsSent"
   FROM "BETArchiveFirstGeneration" "FG"
     LEFT JOIN "BulkEmailRecipientReplica" "BERR" ON "BERR"."RecipientId" = "FG"."MandrillId"
UNION ALL
 SELECT "SG"."MandrillId" AS "Id",
    "SG"."CreatedOn",
    "SG"."ModifiedOn",
    "SG"."BulkEmailId",
    "SG"."ContactId",
    "SG"."EmailAddress",
    "BERR"."DCReplicaId" AS "ReplicaId",
    "SG"."LinkedEntityId",
    "SG"."BulkEmailResponseId",
    "SG"."Clicks",
    "SG"."Opens",
    "SG"."ProviderName",
    NULL::text AS "SessionId",
    0 AS "IsSent"
   FROM "BETArchiveSecondGeneration" "SG"
     LEFT JOIN "BulkEmailRecipientReplica" "BERR" ON "BERR"."RecipientId" = "SG"."MandrillId";
 
ALTER TABLE public."VwBulkEmailAudience"
    OWNER TO puser;

 

Like 0

Like

2 comments
Best reply

Hi Federica,

The "BETArchiveFirstGeneration" and "BETArchiveSecondGeneration" tables have been added in the 7.17.1 version of Creatio. They are used as a way to archive old records from the BulkEmailTarget table. Records older than 1 year go into those tables.

To get information about the OLD licenses usage you would need to use the VwBulkEmailTarget view as it looks into both the BulkEmailTarget and BETArchive tables. 

 

Best regards,

Max.

Hi Federica,

The "BETArchiveFirstGeneration" and "BETArchiveSecondGeneration" tables have been added in the 7.17.1 version of Creatio. They are used as a way to archive old records from the BulkEmailTarget table. Records older than 1 year go into those tables.

To get information about the OLD licenses usage you would need to use the VwBulkEmailTarget view as it looks into both the BulkEmailTarget and BETArchive tables. 

 

Best regards,

Max.

Thank you very much Max for clarifying! :)

Show all comments

hi all,

 

I need the to enable the SQL query console but I can't find the SQL executer and can't find the option "SQL query console" in operation permissions 

 

any sol?

 

thanks 

Like 0

Like

4 comments

Hi Ibrahim,

 

Unfortunately, the SQL query console plugin is not supported anymore. As of now there are no alternatives but we are working on creating one. You can send the scripts you need to execute to our support address support@creatio.com and we will run them for you!

 

Best regards,

Max.

I am currently working on a new marketplace add-on for this as well.

For now, if you have the previous SQL Executor add-on in another system, you can export the package from the configuration to install into another system.

Ryan

Ryan Farley,

wondering if you have already created something useable, because the old SQL console is not really working anymore in the latest releases.

 

I'd be happy to contribute either with testing or development!

 

Thanks for your effort!

Ryan Farley,

Ditto, I'd be happy to contribute either with testing or development!

Show all comments

Hello community,

I am implementing a way to import/export organizational data. The thing I want to do is create a business process that will transfer the data from SysAdminUnitCopy to SysAdminUnit and vice versa.  For the transfer of this data I created a script in sql server which transfers this data and executes successfully.

The next thing i need to do now is put this script in a sql script type schema and call it from a process.

Is there any way to call/execute a sql script schema from a business process?

 

Like 0

Like

1 comments

Hi community,

 

When implementing a web service, I have a GET method with a parameter :

 

public int GetMethod(string name)

 

In this method, I did a query to get the age of the person in parameter :

 

var select = new Select(UserConnection)

     .Column("Age")

     .From("Contact")

     .Where("Contact", "Name").IsEqual(Column.Parameter(name)) as Select;

 

Then I save the age into an int var :

 

var age = select.ExecuteScalar();

 

return age;

 

The problem is the following :

 

How can I check if the name of a contact in the method parameter exsists in the DB or not ?

 

Example :

 

if(name != exists) {

   return 0;

} else {

  return age;

}

 

Thanks a lot.

 

Best regards,

Jonathan

Like 0

Like

4 comments
Best reply

Hi Jonathan,

 

Usually you use dataReader to get the value from your select query. What you can do is:

bool hasRecord = false;
using (DBExecutor executor = UserConnection.EnsureDBConnection()) {
using (IDataReader dataReader = select.ExecuteReader(executor)) {
  while (dataReader.Read()) {
    hasRecord  = true;
  }
 }
}
if(hasrecord){
  return age
}else{
  return 0
}

Or you can just set the default value of the age =0. Therefore if the dataReader does not return any record, the default value age (0) will be returned.



regards,

Cheng Gong

Hi Jonathan

 

Please add the next using -     

     using Terrasoft.Common;   

on the top of the page(if you didn't have this one). 

 

Then in the part of the code when you are trying to retrieve the age:

 

if (name.IsNullOrEmpty())

{

return 0;

}

else

{

return age;

}

 

Best Regards, 

 

Bogdan L.

Hi Jonathan,

 

Usually you use dataReader to get the value from your select query. What you can do is:

bool hasRecord = false;
using (DBExecutor executor = UserConnection.EnsureDBConnection()) {
using (IDataReader dataReader = select.ExecuteReader(executor)) {
  while (dataReader.Read()) {
    hasRecord  = true;
  }
 }
}
if(hasrecord){
  return age
}else{
  return 0
}

Or you can just set the default value of the age =0. Therefore if the dataReader does not return any record, the default value age (0) will be returned.



regards,

Cheng Gong

Bogdan Lesyk,

Thanks for your answer. It helped a lot !

Cheng Gong,

 

Your answer is really perfect ! Thanks a lot, i'll definitely save this snippet of code for my future implementations.

 

Regards,

Jonathan

Show all comments