I have created a script to turn integers into words and it keeps compiling with errors.

 

heres the script:

 

using System;
using System.Text;
using Terrasoft.Core;
using Terrasoft.Core.Entities;
using Terrasoft.Core.Process;

public class ConvertCurrencyToTextTask : ProcessUserTask
{
   // ✅ Constructor
   public ConvertCurrencyToTextTask(ProcessExecutingContext context) : base(context) { }

   // ✅ Main execution method (Runs when the Script Task is triggered)
   public override bool CompleteExecuting(UserConnection userConnection)
   {
       try
       {
           // ✅ Retrieve the requested amount from the process parameter
           decimal requestedAmount = Get("DfcReqAmt");

           // ✅ Retrieve the dynamically fetched record ID
           Guid recordId = Get("Id");

           // ✅ Convert the numeric amount to words
           string convertedText = ConvertToWords(requestedAmount);

           // ✅ Store the result in the output parameter
           Set("DfcRequestedAmountText", convertedText);

           // ✅ Update the record in the FinApplication object
           UpdateRecord(userConnection, recordId, convertedText);
       }
       catch (Exception ex)
       {
           throw new Exception("Error in ConvertCurrencyToTextTask: " + ex.Message);
       }

       
   }

   // ✅ Converts numbers to words (DYNAMIC)
   private string ConvertToWords(long number)
   {
       if (number == 0)
           return "Zero";

       if (number < 0)
           return "Negative " + ConvertToWords(Math.Abs(number));

       string words = "";
       int thousandIndex = 0;

       while (number > 0)
       {
           if (number % 1000 != 0)
           {
               words = ConvertHundreds(number % 1000) + Thousands[thousandIndex] + " " + words;
           }
           number /= 1000;
           thousandIndex++;
       }

       return words.Trim();
   }

   // ✅ Converts hundreds, tens, and ones
   private string ConvertHundreds(long number)
   {
       string words = "";

       if (number >= 100)
       {
           words += Ones[number / 100] + " Hundred ";
           number %= 100;
       }

       if (number >= 10 && number <= 19)
       {
           words += Teens[number - 10] + " ";  // ✅ Corrected indexing for Teens
       }
       else
       {
           words += Tens[number / 10] + " ";
           words += Ones[number % 10] + " ";
       }

       return words.Trim();
   }

   // ✅ Updates the record with the converted text
   private void UpdateRecord(UserConnection userConnection, Guid recordId, string convertedText)
   {
       if (recordId == Guid.Empty) // ✅ Ensures ID is valid before updating
           throw new Exception("Record ID is empty, cannot update record.");

       var entitySchema = userConnection.EntitySchemaManager.GetInstanceByName("FinApplication");
       var entity = entitySchema.CreateEntity(userConnection);

       if (entity.FetchFromDB(recordId))
       {
           entity.SetColumnValue("DfcRequestedAmountText", convertedText);
           entity.Save();
       }
   }

   // ✅ Number arrays (DYNAMIC)
   private readonly string[] Ones = { "", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine" };
   private readonly string[] Teens = { "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen" };
   private readonly string[] Tens = { "", "", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety" };
   private readonly string[] Thousands = { "", "Thousand", "Million", "Billion", "Trillion" };
} // ✅ Class correctly closed

 

 

return true; // ✅ Ensures method completes properly
 

 

 

 

these are the errors I am getting:

 

DfcProcess_25a93f1.DfcLoans.cs    Identifier expected    CS1001    34
DfcProcess_25a93f1.DfcLoans.cs    Identifier expected    CS1001    33
DfcProcess_25a93f1.DfcLoans.cs    Identifier expected    CS1001    35
DfcProcess_25a93f1.DfcLoans.cs    Type or namespace definition, or end-of-file expected    CS1022    151
DfcProcess_25a93f1.DfcLoans.cs    } expected    CS1513    36
DfcProcess_25a93f1.DfcLoans.cs    Identifier expected    CS1001    32
DfcProcess_25a93f1.DfcLoans.cs    Identifier expected    CS1001    36

 

Not sure what is missing as far as syntax goes, all bracket appear to be in place.

 

Appreciate the help in advance.

 

 

 

 

Like 1

Like

4 comments

Hi,

 

The error is related to the business proceess DfcProcess_25a93f1. Can you share a source code for the business process, not the user task you shared? You can get the source code of the business process here:

There was no source code?

Hello,
 

In this case, do you perform development on a local environment?

If so, could you search for the schema in the {rootAppFolder}\Terrasoft.WebApp\Terrasoft.Configuration\Pkg\DfcLoans\Autogenerated\Src\DfcProcess_25a93f1.DfcLoans.cs directory?

You can also find the location of the file that causes compilation errors if you look at the application logs (Build.log) for the day of compilation and errors.

Show all comments

Hello,

 

I'm wanting to setup a business process so that when a user is mentioned in the feed they receive an email notification. Also, there may be instances where more than 1 user is mentioned in a single comment and I'd want each person to get an email notification in that case.

 

I've tried creating this business process and am stuck as it sends the notification to the person who created the comment in the feed, not the user mentioned in the comment. Any tips on this are greatly appreciated!

 

Thank you,

 

Eric

Like 0

Like

5 comments
Best reply

Hi Eric,

try to use such signal on the object 'User mention' and send notification to Contact:

Hi Eric,

try to use such signal on the object 'User mention' and send notification to Contact:

Thank you! That did it. What's the best method to provide a link to the record via an email? I tried following the steps here - https://community.creatio.com/questions/link-based-feed-notification but it appears to break when there are replies to an existing comment.

 

Eric Curran,

We have such formula (it is for Classic UI, but you can change it for Freedom UI):

"<a href=\""+[#System setting.Website URL#]+"/0/Nui/ViewModule.aspx#CardModuleV2/"+[#Page name#]+"/edit/"+[#Object Id#]+"\">"+[#Record title#]+"</a>"

Eric Curran,

We have implemented this way for replies:

Vladimir Sokolov,

Thanks so much for the assistance! I do have one follow up question, what is the best way to limit this process to a certain object? We only want to turn on these notifications for one object, not every object.

Show all comments

Hello!
I created a new Functional role with oData operations permission and add it to User. 
Using Postman can GET data from "Contact" collection with this User credentials. It also can create new Contact using POST method.
PATCH returns:  403 - Forbidden: Access is denied
DELETE returns:  405 - HTTP verb used to access this page is not allowed

What permissions I have to grant to this Functionsl role and how?

This instruction
https://academy.creatio.com/docs/developer/integrations_and_api/data_se…
say for 405
"The response should contain the Allow header with the list of request methods the resource supports."
Postman returns:
 405 - HTTP verb used to access this page is not allowed

 The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.

 

Can you help?

Like 0

Like

1 comments
Best reply

Greetings! 

 

For the user to work through OData, you need to grant them access using the CanUseODataService code in the Operation permissions section. 

Greetings! 

 

For the user to work through OData, you need to grant them access using the CanUseODataService code in the Operation permissions section. 

Show all comments

Hi,

 

I want to make a validator that endDate cannot be erlier than leave startDate, in endDate field in viewModelConfigDiff,

Expectation:

 

My Code:

 

"PDS_UsrLeaveEndDate_quo1xia": {
	"modelConfig": {
		"path": "PDS.UsrLeaveEndDate"
	},
	"validators": {
		"MySuperValidator2": {
			"type": "usr.FutureDateValidator2",
			"params": {
				"message": "#ResourceString(EndDateWarning)#",
				"startDate": "PDS_UsrLeaveStartDate_apq3vdm"
			}
		}
	}
}

 

   "usr.FutureDateValidator2": {
                validator: function (config) {
                    return function (control) {
                        let value = control.value;
                       let startDate =  config.startDate;
                        let valueIsCorrect = value > startDate;
                        var result;
                        if (valueIsCorrect) {
                            result = null;
                        } else {
                         console.log(startDate);
                         console.log(value);
                            result = {
                                "usr.FutureDateValidator2": { 
                                    message: config.message
                                }
                            };
                        }
                        return result;
                    };
                },
                params: [
                    {
                        name: "message"
                    },
                 {
                        name: "startDate"
                    }
                ],
                async: false
            },

 

But, value of startDate from the params is a String, how to get the actual value?

 

Thank you

Like 0

Like

1 comments

Currently, you cannot pass the value of another field to a validator, this function is still under development. However, you can write something similar using global variables as described in this discussion.

Show all comments

Hi all,

 

I would like to know if and how it is possible to add a font for configuring email account signature.

 

Best regards

 

stefano

 

Like 0

Like

1 comments

Hello,

To upload new fonts and use them in emails, you need to change the values of the system settings "CKEditor fonts list" ("CKEditor fonts list") and "CKEditor default font" ("CKEditor default font"). 

The "CKEditor fonts list" system setting is responsible for which font you will be able to see in the font drop-down list. It should be added to the beginning of the system setting list, with ";". 

Accordingly, in order to use this font, they just need to be installed on the server as a regular font. 

It is also necessary to know that if the recipient does not have this font, he will not see this font.

More information can be found in this instruction.

Best regards,
Antonii.

Show all comments

Hi, everybody!

 

I work on Classic UI. I have a task: to realize opening mini-page instead of full page in Account Lookup by clicking Add Button. 

 

I managed to do it in runtime mode.

 

To do this, it was necessary to make a change to the basic client module  LookupPageViewModelGenerator.js, the needOpenMiniPage method.

But I couldn't override this basic module in the configuration and connect it to my page.

 

Code of my new LookupPageViewModelGenerator:

define("LVLookupPageViewModelGeneratorV2", ["LookupPageViewModelGenerator"], function(LookupPageViewModelGenerator) {
 
Ext.define("Terrasoft.configuration.LVLookupPageViewModelGeneratorV2", {
extend: "Terrasoft.LookupPageViewModelGenerator",
		needOpenMiniPage: function(entitySchemaName) {
		this.lookupInfo.isQuickAdd=true; // додано
		const notUseSilentCreation = !Terrasoft.Features.getIsEnabled("UseSilentCreation");
		const entityStructure = moduleUtils.getEntityStructureByName(entitySchemaName);
		const editPages = entityStructure.pages;
		const hasAddMiniPage = editPages[0].hasAddMiniPage;
		return notUseSilentCreation && this.lookupInfo.isQuickAdd && !Ext.isEmpty(hasAddMiniPage);
				},
    		});
    return Terrasoft.configuration.LVLookupPageViewModelGeneratorV2;
});

 

Code of my page where lookup is contained:

define("ELFinApplicationAccountPage", ["LVLookupPageViewModelGeneratorV2"],  function() {
return  {
entitySchemaName: "FinApplication",
attributes: {},
messages: {},
details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
businessRules: /**SCHEMA_BUSINESS_RULES*/ {}/**SCHEMA_BUSINESS_RULES*/,
methods: {},
diff: /**SCHEMA_DIFF*/[
			{
          operation: "insert",
          name: "LVPartnerWhoRecommended",
          parentName: "AdditionalProfileInfoContainer",
          propertyName: "items",
          values: {
            layout: {
              column: 0,
              row: 6,
              colSpan: 24
            }
          }
        },
         ]/**SCHEMA_DIFF*/
         };
});

 

I wrote this code while I was reading this article: https://community.creatio.com/questions/add-mini-card-contact-lookup-new-optionbutton. But maybe I made a mistake or didn`t take smth into account.

What do I have to do to make this work?

 

Thank you!

Like 3

Like

1 comments

Hello,
Try creating a full copy of this schema (not override) with the modified method needOpenMiniPage and connect this copy in the define of the needed schema.
Also, in newer versions, you can unlock a package for a hotfix, with it, you can modify a base schema directly.

Show all comments

Hello Everyone, 

 

I created a Dynamic DCM that includes some sub-processes to validate lists on my form page. If validated correctly the stage should continue forward. the first stage works just fine it proceeds. When I validate the following one though the stage does not change. I have re-checked my BP multiple times to ensure it has taken the appropriate path and also the result conditions set in order for the case to move forward dynamically and they both check out. Any idea what the issue could be?

Like 0

Like

1 comments

Hello,

 

Here are a few additional steps you can take to troubleshoot the issue:

  • Ensure that the validation logic in your sub-processes is correctly implemented and that it returns the expected results.
  • Double-check the transition conditions between stages to ensure they are correctly configured and that they match the output of your validation logic.
  • Look at the case logs to see if there are any errors or warnings that might give you more insight into why the stage is not progressing.
  • Try testing the process with different sets of data to see if the issue is data-specific.
  • Ensure that the user executing the process has the necessary permissions to move the case forward.
Show all comments

Hi all,

 

We have noticed that in formatting options of a Rich Text field there is the possibility to 'Align left', 'Center' and 'Align right'.

 

Is there a way to enable also 'Justify' formatting option?

 

Best Regards

 

Stefano
 

Like 0

Like

1 comments

Dear Stefano,

Unfortunately, currently, there is no option to justify the format in Rich text. 

I have created an idea for the R&D team.


Thank you for making Creatio better!

Show all comments

Hi Community,

I noticed that in the Business Process Configuration, we can set a Static value when open a page.

Is there a workaround to set a static value when opening the page through the page editor configuration or client-side code?

 

Setup via page editor(Can't set static value)

Setup via code (without setup param)

Like 0

Like

4 comments
Best reply

Resolved using client-side code customization

Hello,
If the page is opened outside of a business process but still requires a static value to be applied, the page must represent an object. You can achieve this by setting up a business rule.

In the business rule, you can define an "If" condition to check whether the necessary field is empty. If it is, the rule will automatically assign the desired value to that field.

Hello Nick,

Thank you for your response.

The reason I want to set a static value for the page parameter when opening the page is that I have a modal for confirming the delete process. The value from the page parameter will be used to determine which object is being deleted when the "YES" button is clicked.

That's why I need to assign a static value to the page parameter based on where the confirmation modal is being used. Currently, i can set static value using the Business Process (BP), but I don’t think it’s good practice to rely on BP only for opening the page.

Unfortunately, there are no default values for page parameters at the moment. I will register this idea for future development.
As for now, this can only be implemented via BP or through development.

Resolved using client-side code customization

Show all comments

I recently completed the Development on Creatio guided learning course. With my instructor's assistance, I set up a local Creatio instance—labeled Dev1_DEV—on my Windows server.
 

After switching my D1_DEV local development environment to use File System Development Mode instead of the default Creatio IDE mode, I encountered an issue where my Creatio instance failed to load the necessary JS files related to SectionModuleV2 for Classic UI sections (e.g., System Settings, Lookups). I reverted my Web.Config file changes to disable File System Development Mode, which resolved the issue.
 

For reference, I have attached screenshots of the error messages from my console when attempting to access Classic UI sections while File System Development Mode was enabled.
 

Could you help me understand why switching to File System Development Mode prevents access to the required JS files for Classic UI sections? Aside from modifying the Web.Config file, I did not make any other changes to the system. 

Any guidance on resolving this would be greatly appreciated.

Like 0

Like

7 comments

Hello,

 

We recommend checking if all the steps from the article have been completed:

https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…

 

For example, ensure that these values are set:

<fileDesignMode enabled="true"/>
...
<add key="UseStaticFileContent" value="false"/>


All steps must be completed.

Hello Kalymbet,
Hope all is well. 

Thank you for providing that link. I followed its steps listed on the page as follows: 
Enabled file design mode
Disabled UseStaticFileContent 
Compiled my instance (no errors)
Downloaded packages to file system successfully (no errors)
Gave IIS Usr full access to the Terrasoft.Configuration file

I still received the same error. It looks like it is not able to find the SectionModuleV2.js file. 




 

Kalymbet Anastasia,

 

Hello,
 

We also recommend that the user under which the application pool is running should also have full access to the {rootAppFolder}\Terrasoft.WebApp folder

Folder access

Serhii Parfentiev,

Thank you for the suggestion. I added Full control access to the IIS User for the Terrasoft.WebApp folder and I still received the same issue. For reference, I attached an image of the Terrasoft.WebApp security properties. 

 

Hello,
Could you please verify under which user the Application Pool is running? If you have changed the user, please make sure to grant permissions for this user too.

If this doesn't help, additionally please try the following scenario:
1) Deploy the application.
2) Authorize and allow the inner part of the application to initialize (after login, wait for the application to finish loading).
3) Only after that, make changes in the Web.config file to enable development on the file system and follow further instructions. 

Show all comments