Hii

I've implemented a method for searching the "City" table by a partial city name match using a wildcard search in the SQL query. The objective is to retrieve the associated "CountryId" based on a partial match of the city name provided.

However, upon deployment, an error occurred, preventing the successful execution of the query. The code snippet is structured to perform a wildcard search using the Like clause, but it seems there might be an issue with its implementation.

Here is the code snippet in question:



public string SelectCountryIdByCityName(string CityName)
{
    var result = "";
    var sel = new Select(UserConnection)
            .Column("CountryId")
        .From("City")
        .Where("Name").Like(Column.Parameter("%" + CityName + "%")) as Select;
    result = sel.ExecuteScalar().ToString();
    return result;
}

I am seeking guidance or any insights you may have regarding the correct implementation of a wildcard search in SQL queries for partial city name matches.

Your assistance or suggestions on rectifying this issue would be immensely appreciated.

 

Like 0

Like

2 comments

Hi,

 

Any updates on this?

Hi Satyam,

To implement a wildcard search in the SQL query correctly, you need to make some changes in the provided code:

  1. change “Like” to “IsLike”;
  2. replace the “ExecuteScalar” method (which returns a single record) with “DBExecutor” (which allows the return of multiple records). Here are some examples of using it - https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/back-end-development/data-operations-back-end/direct-access/examples/retrieve-data .

 

Best regards,

Natalia

Show all comments

Hi Community,

In mobile application I have a button "Terminar" that when I press it I want run a process from my process library in Creatio.

To implement this button I created the following component and a function "onClickMeButtonClick", that is responsable for executing the process after pressing the button. To execute the process I used "Terrasoft.configuration.ProcessModuleUtilities", but I'm not sure if this is the best way to implement this example.

Any idea on how to develop this logic?

 

Thanks an advance.

 

Best Regards,

Daniel Longo

Like 0

Like

2 comments

Hello Daniel,

 

The mobile application UI doesn't support working with business processes and processes are only triggered on the server side in real-time once the record is modified in the mobile application or record is added (and correspondent start signals are present in some process).

 

Our core R&D team already has a task to make it possible to work with business processes from the UI directly and I will also let them know about your post so to prioritize the task for them.

 

Thank you for helping us in making the app better!

 

Best regards,

Oscar

Thank You Oscar.

I think it is a important feature for the application, so that the actions of the buttons can be dynamic and don't just give it "Message Alerts".

 

Best Regards,

Daniel Longo

Show all comments

After I created a Business Process, somehow it caused my custom page "Concert Programs" to lose the list of values/records and they no longer display.  I deleted the process hoping this would fix it, but have not been able to fix the issue.  My custom page gets the error in the screenshot. (Cannot read "attribute" property of undefined) .  I investigated the code which I also have a screenshot and it appears my custom entity "UsrConcertPrograms" is missing from the list.  Can you point me in the direction to resolve?  Thank you.

Like 1

Like

1 comments

Dear Darlene, 

 

If it is dev environment or you don't have any important data created after the issue occurred, probably the best and the fastest option would be to roll back to the backup made before the issue occurred (if the site is in cloud the backups are made daily, if you have on-site installation it depends on your configuration). If rolling back is not an option for you, you can try to generate the source code for all and compile all in configuration, it may help. If the issue would still occur after that, the issue needs to be debugged to fix it: 

https://academy.creatio.com/documents/technic-sdk/7-16/client-code-debugging

As you've mentioned that your custom entity is missing most likely it is either removed completely and in this case, you can try to recreate it. Also, one of the possibilities is that the corresponding SysModule record was removed, In this case, you can restore it following the steps in the community article below (please note that most likely SysModuleEntity and SysModuleEdit records still exist, however they may have been removed as well): 

https://community.creatio.com/articles/register-custom-section-existing-object

If you would need help with this please contact support at support@creatio.com because it is hard to tell the exact root cause in your case without debugging the issue.

Show all comments