Hi community,

I’m working on a custom web service in Creatio that connects to an external PostgreSQL database deployed on Neon. My goal is to query data from this external database, acting like a custom ORM. However, I’m running into an issue with using the Npgsql package inside Creatio’s source code.

 

I’ve added the necessary references, but I keep getting the following error:

The type or namespace name 'Npgsql' could not be found (are you missing a using directive or an assembly reference?)

 

I’ve already added the Npgsql.dll to the Terrasoft.web/bin folder and modified the web.config to include a binding redirect for Npgsql. After restarting the IIS server and flushing Redis, I now get a 'System.Data.Common' assembly error.

Here’s the code I’m using:

using Npgsql;
using System;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.ServiceModel.Activation;
using System.Data;
using System.Collections.Generic;
using Terrasoft.Core;
using Terrasoft.Web.Common;
 
namespace Terrasoft.Configuration
{
    [ServiceContract]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class PostgresService : BaseService
    {
        private string connectionString;
 
        public PostgresService()
        {
            // PostgreSQL connection string
            connectionString = "Host=your_host;Port=5432;Database=your_database;Username=your_username;Password=your_password";
        }
 
        [OperationContract]
        [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "GetData")]
        public List<Dictionary<string, object>> GetData()
        {
            var result = new List<Dictionary<string, object>>();
            try
            {
                using (var connection = new NpgsqlConnection(connectionString))
                {
                    connection.Open();
                    string sql = "SELECT * FROM users LIMIT 100";
 
                    using (var cmd = new NpgsqlCommand(sql, connection))
                    using (var reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            var row = new Dictionary<string, object>();
                            for (int i = 0; i < reader.FieldCount; i++)
                            {
                                row.Add(reader.GetName(i), reader.GetValue(i));
                            }
                            result.Add(row);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception($"Error retrieving data: {ex.Message}");
            }
 
            return result;
        }
 
 
 
    }
}

 

Like 1

Like

1 comments

Hello,

 

Please revert all the changes and perform the setup in the following manner:

 

  1. 1) Deploy another website that will be used as a mediator between the custom PostgreSQL database and your local Creatio app.
  2. 2) Create an endpoint in this separate server that can be accessed either via POST\GET request and that can receive some parameters in the request body.
  3. 3) Create a code in this separate server that will communicate with the custom PostgreSQL server in some method (that will be used as an endpoint to be called).
  4. 4) Call this endpoint from the webservice in local Creatio app and get data from the database as a JSON string and then process it as you need in the local Creatio app.
Show all comments

Hi,

I've got two separate cases where a contact's phone number is displaying as [#PhoneNumber#]:


I've checked the Submitted Forms for both contacts and in each case a phone number was entered:



However, when I look at the Submitted form in table view, the phone number shows up as [#PhoneNumber#] again:


Do you know what might be causing this?

Thanks!

Like 0

Like

1 comments

Hello,

 

Unfortunately, without advanced information about your form setup, it is impossible to tell what exactly went wrong with the number registration.

You can provide the setup in the topic so other users would have a better idea of what exactly is causing the number to be rendered in such a format or create the support ticket so the Creatio employees will have a chance to research this issue.

 

Thank you for being an active part of the Creatio Community!

Show all comments

Hello,
I have a slightly urgent question on how to get Address from Account lookup
the code lookslike this
Terrasoft.sdk.Model.addBusinessRule("Activity", {

  name: "LatLongPreFilled",

  ruleType: Terrasoft.RuleTypes.Custom,

  triggeredByColumns: ["Usrcheck_in"],

  events: [

    Terrasoft.BusinessRuleEvents.ValueChanged,

    Terrasoft.BusinessRuleEvents.Save,

  ],

  executeFn: function (model, rule, column, customData, callbackConfig) {

    if (navigator.geolocation) {

      navigator.geolocation.getCurrentPosition(

        function (position) {

          model.set("Usrcheck_in_longitude", position.coords.longitude, true);

          model.set("Usrcheck_in_latitude", position.coords.latitude, true);


 

          var account = model.get("Account").get("Address");


 

          alert(account);

          Ext.callback(callbackConfig.success, callbackConfig.scope);

        },


 

        function (error) {

          alert("Geolocation failed: " + error.message);

          Ext.callback(callbackConfig.success, callbackConfig.scope);

        }

      );

    } else {

      alert("Geolocation is not supported by this browser.");

      Ext.callback(callbackConfig.success, callbackConfig.scope);

    }

  },

});


i use this: var account = model.get("Account").get("Address"); 
but when i test it, displayed on an alert it says "undefined", but this model.get("Account").get("Id"); or model.get("Account").get("Name"); works fine.
Can anyone help me out? 

Thank you.  

Like 1

Like

3 comments

Hello,

 

Please check if the Address column is present in the SyncColumns array of the Account entity in the ModelDataImportConfig array of the mobile application manifest. It seems that the column is not synced so you receive undefined in the debugger.

Oleg Drobina,


Hi Oleg,
thanks for the reply,

should i add manually on Mobile manifest file or via Mobile Application Wizard?
PS: i don't use debugger like console.log, i use javascript's alert function since i use iOS and i have no clue on how to debug mobile apps on a smartphone, especially iOS.

Yanuar Adinagoro Vishnu Saputro,

 

It can be either manually or you can add the Address column to the account edit page and the column should be added to the manifest automatically in this case.

Show all comments

Hello community,

 

I've configured an entity with a column with default value from system settings.

When I install the package I received the error the system settings used for default does not exist.

What am I doing wrong?

Like 0

Like

2 comments

Did you include the system setting (SysSettings) and the system setting value (SysSettingsValue) in the package as well?

Ryan

Ryan Farley,

Hi Ryan

Both SysSettings and SysSettingsValue are defined.

I've done some test and the problem is the missing value in the SysSettingsValue.

Show all comments

Hi Community, 

 

We are looking to insert non-contact macros in email template. We have an object with two fields - rate and duration. These fields are not connected to any object and have only one record. We want to insert these two values in an email template. How can we go about it?

 

Thanks

Like 0

Like

1 comments

Hello!

 

In the current version of the system, macros cannot be added from objects that are not linked to a contact or to bulk emails in the template. The object must be connected to a contact for the macros to be available. 

 

We created a request to our development department for further implementation in the next versions of the system. 

Show all comments

Hi everyone,

I’m working on a custom web service and tried integrating Npgsql. After encountering a "no namespace found" error, I took the following steps:

  1. Added the Npgsql.dll file to the Tearsoft.web/bin directory.
  2. Modified the web.config file with the following binding redirect:

    xml
     

  3. <dependentAssembly>
        <assemblyIdentity name="Npgsql" publicKeyToken="5d8b90d52f46fda7" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-8.0.5.0" newVersion="8.0.5.0" />
    </dependentAssembly>
  4. Restarted the IIS server.
  5. Flushed Redis via the Clio CLI.

After these steps, I'm now facing the following error: Could not load file or assembly 'System.Data.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. (Screenshot attached for reference)

I've already checked assembly binding logging, but I’m unsure how to resolve this error. Any suggestions or help would be appreciated!
 

Additional Context:

  • Working with PostgreSQL using Npgsql in the custom web service.
  • I made changes to the web.config file after adding the Npgsql DLL.


    this is the current state for my local instance .
     

Thanks in advance!

Like 0

Like

1 comments

Hi,

This issue requires a deeper analysis, and we advise you to create a case for Creatio support.

Thank you!

Show all comments

Hello Creatio Community,

 

I am currently following Responding to an Change Event When a Field is Changed on a Creatio Freedom UI Page to auto-save the record when a number field is modified.

While the auto-save feature works, I’ve encountered an issue when filling in the number field. If I input more than two digits, the system interprets this as multiple changes (e.g., entering "125" is seen as three separate changes: "1", "12", and "125"). This triggers the auto-save and refresh process repeatedly, lasting around 30 seconds.

As a result, instead of saving "125", it starts saving and refreshing before I finish entering the complete value.

Is there a way to resolve this issue to prevent it from auto-saving prematurely while I'm still entering data?

 

Below is the script I am using for reference. Any guidance or suggestions would be greatly appreciated.

Thank you in advance!

 

Best regards,
Jin

Like 0

Like

0 comments
Show all comments

Hi,

 

as I read in Academy (https://academy.creatio.com/docs/8.x/no-code-customization/customizatio…):

"Display the index of posts and comments that mention the current user or those to which the user is subscribed."

Actually when we don't use subscription (delete all records from 'Follow' object), mentioned posts are not displayed either. 
Besides, we would like to display there posts of current user.

Is it possible to make such modification?

Kind regards,
Vladimir

Like 0

Like

1 comments

Hi,

 

We noticed that you have already contacted Creatio support regarding this issue. 

We will analyze this business case in detail and provide you with possible solutions within the case.

Show all comments

Hello Community,

 

    I want to display Process Execution custom message on the UI while process in running status. 
    
    How can I display this message using a popup, similar to the one shown in the image below?

 

Like 0

Like

1 comments
Best reply

If you want to display toast messages from a process, you'll need to (1) have a script task in the process that sends the message to the UI and (2) code on the front end that receives the message and displays the toast message. 

For sending the messasge from the process to the UI, see https://customerfx.com/article/sending-a-message-from-server-side-c-to-client-side-javascript-in-bpmonline/

For the toast you can see that here https://customerfx.com/article/displaying-toast-message-popups-from-creatio-freedom-ui-pages/

Ryan

If you want to display toast messages from a process, you'll need to (1) have a script task in the process that sends the message to the UI and (2) code on the front end that receives the message and displays the toast message. 

For sending the messasge from the process to the UI, see https://customerfx.com/article/sending-a-message-from-server-side-c-to-client-side-javascript-in-bpmonline/

For the toast you can see that here https://customerfx.com/article/displaying-toast-message-popups-from-creatio-freedom-ui-pages/

Ryan

Show all comments

Hello Creatio Community,

 

I am currently following Responding to an Change Event When a Field is Changed on a Creatio Freedom UI Page to auto-save the record when a number field is modified.

 

While the auto-save feature works, I’ve encountered an issue when filling in the number field. If I input more than two digits, the system interprets this as multiple changes (e.g., entering "125" is seen as three separate changes: "1", "12", and "125"). This triggers the auto-save and refresh process repeatedly, lasting around 30 seconds.

 

As a result, instead of saving "125", it starts saving and refreshing before I finish entering the complete value.

 

Is there a way to resolve this issue to prevent it from auto-saving prematurely while I'm still entering data?

 

Below is the script I am using for reference. Any guidance or suggestions would be greatly appreciated.

 

Thank you in advance!

 

Best regards,
Jin

Like 1

Like

1 comments

The best option in this case is to make a saving after losing focus from the input. To implement it, you may use the blurred event on the input and add a custom handler, in which you can save the card.

Best regards,

Anhelina!

Show all comments