Время создания
Filters

Is this method for adding current date to a word report still valid? https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/8.1/platform-customization/classic-ui/ms-word/examples/create-ms-word-report-custom-macros#title-15703-2  After compiling Creatio can't find refs to IExpressionConverter or ExpressionConverterAttribute.

 

Regards,

Michael

Like 0

Like

0 comments
Show all comments

Hello all,

Is it possible in Freedom UI to add folders to sections other than Contacts? We need to enable static folders in the Knowledge Base.

Like 0

Like

0 comments
Show all comments

Hi Community,

We have a case where we are using excel reports that will output an excel that has data about order lines and need some fields to be generated dynamically and others to be static

For the dynamic fields it is easy, but for the static fields does any one have any idea on how to implement it?

One that is not adding one field in the order lines object per column in the excel report(this is the only solution I can think of now and it is not a very good one)

 

Thanks,

Luis

Like 0

Like

1 comments

You could add some bogus column and then in the template use a formula to replace it with some static value. Either that or use a database view for the report and have the static values there. Not sure it’s possible without something like that. 
Ryan

Show all comments

Hi Creatio Community,

We're encountering a puzzling issue on a Freedom UI List Page (specifically, our Invoices_ListPage) when trying to run a business process (IWVoid_API_POST) using a custom JavaScript handler. The goal is to test the business process by explicitly passing a hardcoded InvoiceId, as requested for a specific testing scenario where the button is not on the individual record's form page.

Our Setup:

  1. The Button (Menu Item on List Page's ActionButton):

    We've added a crt.MenuItem to the ActionButton on our Invoices_ListPage. This menu item is intended for testing and is configured to trigger a custom handler:

    JSON

     

    // In viewConfigDiff of Invoices_ListPage.js
    {
        "operation": "insert",
        "name": "TargetVoidButton", //
        "values": {
            "type": "crt.MenuItem",
            "caption": "Test Void BP (Hardcoded ID)", 
            "icon": "debug-icon",
            "visible": true,
            "clicked": {
                "request": "crt.HandleButtonClickRequest",
                "params": {
                    "buttonName": "RunTargetVoidProcessHandler" 
                }
            }
        },
        "parentName": "ActionButton",
        "propertyName": "menuItems",
        "index": 3 
    }
  2. The Handler (in handlers array of Invoices_ListPage.js):

    This handler is designed to run the IWVoid_API_POST process with a specific, hardcoded InvoiceId.

    JavaScript

     

    // In handlers array of Invoices_ListPage.js
    {
        request: "crt.HandleButtonClickRequest",
        handler: async (request, next) => {
            if (request.buttonName === "RunTargetVoidProcessHandler") { 
                console.log("RunTargetVoidProcessHandler triggered.");
                Terrasoft.showInformation("Test: Running process with hardcoded ID. Check console.");
     
                const processName = "IWVoid_API_POST";
                const hardcodedInvoiceIdForTest = "3c2b6d9f-4c1e-4364-99f2-53956562b606"; 
                const parameterNameInProcess = "InvoiceId"; 
     
                console.log(`Test: Attempting to run BP '<span class="math-inline">\{processName\}' with EXPLICIT HARDCODED ID '</span>{hardcodedInvoiceIdForTest}' for parameter '${parameterNameInProcess}'.`);
     
                try {
                    const response = await request.$context.executeRequest({
                        type: "crt.RunBusinessProcessRequest",
                        params: {
                            processName: processName,
                            processParameters: {
                                [parameterNameInProcess]: hardcodedInvoiceIdForTest
                            },
                            saveAtProcessStart: false, 
                            showNotification: true 
                        }
                    });
     
                    console.log("Test: BP execution request completed. Response:", response);
     
                    if (response && response.success === true && response.processId && response.processId !== '00000000-0000-0000-0000-000000000000') {
                        const successMsg = `Test: BP '${processName}' (ID: ${response.processId}) initiated. Check Process Log.`;
                        console.log(successMsg);
                        request.$context.showInformationDialog?.(successMsg);
                    } else {
                        let errorMsg = `Test: Failed to start BP '${processName}'.`;
                        let serverDetails = (response && response.errorInfo && response.errorInfo.message) ? response.errorInfo.message : "Details unavailable or process not found (zero ID / success:false).";
                        errorMsg += ` ${serverDetails}`;
                        console.error(errorMsg, "Full response:", response);
                        request.$context.showErrorDialog?.(errorMsg);
                    }
                } catch (error) {
                    console.error(`Test: Exception for BP '${processName}':`, error);
                    let exceptionMsg = (error instanceof Error && error.message) ? error.message : "Client-side exception.";
                    if (error.errorInfo && error.errorInfo.message) {
                        exceptionMsg = error.errorInfo.message;
                    }
                    request.$context.showErrorDialog?.(`Test: Error triggering BP: ${exceptionMsg}`);
                }
                return; 
            }
            return next?.handle(request);
        }
    }

The Problem:

When we click the "Test Void BP (Hardcoded ID)" menu item, the handler triggers, and the client-side logs show the crt.RunBusinessProcessRequest is being prepared correctly with processName: "IWVoid_API_POST" and the hardcoded InvoiceId.

However, the server responds with:

{
  processId: '00000000-0000-0000-0000-000000000000', 
  processStatus: 0, 
  resultParameterValues: null, 
  executionData: null, 
  success: false, 
  errorInfo: {
    errorCode: "ItemNotFoundException",
    message: "Item process schema \"\" not found.", // Note the empty quotes for schema name
    stackTrace: null
  }
}

The key error is <strong>Item process schema "" not found.</strong>

What We've Tried:

  • Confirmed the schematic name (Code) of our business process is indeed IWVoid_API_POST.
  • Confirmed the input parameter in the BP designed to take the ID is named InvoiceId.
  • Repeatedly saved, compiled, and published the IWVoid_API_POST business process and ensured it's marked as "Active."
  • Checked the package containing the process for any errors and recompiled the package.
  • Performed thorough browser cache clearing and hard refreshes (Ctrl+F5).
  • We also have another menu item on the same list page ("VoidInvoice") that uses a declarative crt.RunBusinessProcessRequest with processRunType: "ForTheSelectedRecords" and parameterMappings: { "InvoiceId": "Id" }. When a record is selected and this menu item is clicked, it successfully starts the <strong>IWVoid_API_POST</strong> process (verified in Creatio Process Log with a non-zero instance ID). This makes the current error even more puzzling.

Our Questions for the Community:

  1. Why would the ProcessEngineService report Item process schema "" not found (with empty quotes for the schema name) when the processName: "IWVoid_API_POST" is explicitly and correctly provided in the params of crt.RunBusinessProcessRequest from our custom handler?
  2. Is there any known difference in how process names are resolved or how schemas are looked up by the server when crt.RunBusinessProcessRequest is invoked programmatically from a handler with processParameters explicitly set (using a hardcoded ID), versus when it's invoked declaratively with processRunType: "ForTheSelectedRecords" or processRunType: "ForTheSelectedPage"?
  3. Are there any deeper caching mechanisms (server-side, metadata) or specific registration steps for business process schemas that we might be missing, which could lead to this behavior only for the explicit parameter call?
  4. Has anyone encountered a similar situation where a process is findable/runnable via one SDK invocation method (declarative, context-based) but not another (programmatic handler, explicit parameters) from the same Freedom UI page type?

We are unable to access detailed server-side application logs for this specific environment at the moment, which is hampering deeper diagnosis from our end.

Any insights, suggestions, or similar experiences would be greatly appreciated!

Thank you!

Like 0

Like

0 comments
Show all comments

Hi Team,

I'm currently working on implementing validation for fields like MobilePhone, Email, and HomePhone under the Communication Options section on the Contact_FormPage.

However, I couldn’t find any relevant component or configuration in the Contact_FormPage source code that would allow me to add validation using handler or validator methods directly.

 

I considered using an Entity Event Listener to handle the validation logic, but I noticed that an event handler file already exists in the CrtBase package. Since this file is part of a system package, I’m unable to modify it.

(source-code)

namespace Terrasoft.Configuration
{
    using System;
    using Terrasoft.Common;
    using Terrasoft.Core;
    using Terrasoft.Core.DB;
    using Terrasoft.Core.Entities;
    using Terrasoft.Core.Entities.Events;
    using Terrasoft.Core.ExternalUsers;
    using Terrasoft.Core.Factories;

    #region Class: ContactCommunicationEventListener

    [EntityEventListener(SchemaName = "ContactCommunication")]
    public class ContactCommunicationEventListener: BaseEntityEventListener
    {

        #region Methods: Private

        private bool GetIsExternalUserCommunication(Guid contactId, UserConnection userConnection) {
            var select = new Select(userConnection)
                    .Count("Id")
                .From("SysAdminUnit")
                .Where("ContactId").IsEqual(Column.Parameter(contactId))
                .And("ConnectionType").IsEqual(Column.Parameter(UserType.SSP)) as Select;
            var externalUsersCount = select.ExecuteScalar();
            return externalUsersCount != 0;
        }

        #endregion

        #region Methods: Public

        public override void OnSaving(object sender, EntityBeforeEventArgs e) {
            base.OnSaving(sender, e);
            var entity = (Entity)sender;
            var communicationTypeId = entity.GetTypedColumnValue("CommunicationTypeId");
            if (communicationTypeId != Guid.Parse(CommunicationTypeConsts.EmailId)) {
                return;
            }
            var contactId = entity.GetTypedColumnValue("ContactId");
            var userConnection = entity.UserConnection;
            if (!GetIsExternalUserCommunication(contactId, userConnection)) {
                return;
            }
            var email = entity.GetTypedColumnValue("Number");
            var emailValidator = ClassFactory.Get();
            var isEmailValid = emailValidator.IsValidEmailDomainForExternalUser(email);
            if (!isEmailValid) {
                string message = new LocalizableString(userConnection.ResourceStorage,
                    "ContactCommunicationEventListener", "LocalizableStrings.ErrorMessage.Value");
                throw new SSPRestrictedEmailDomainException(message);
            }
        }

        #endregion

    }

    #endregion

}

Could you please advise on:

  • The recommended approach to implement validation for these communication fields?
  • Whether there’s a supported way to override or extend existing entity event logic from a system package?
     
Like 0

Like

1 comments

Hello,

Yesterday, I created a post regarding this issue here: How to add validator to phone number fields in communication options? | Community Creatio

Oleg already answered, but I couldn't figure it out...maybe you have more luck!

If you want to override the entity event listener, you have to deactivate the "compile into separate assembly" option in your package. This will ensure that your changes are included in the same assembly as the rest of the out-of-the-box configuration.

BR,

Robert

Show all comments