Dear mates,

I can not find why, on my development environment, my Put oData Call return me an permission error:

403 - Forbidden: Access is denied

You do not have permission to view this directory or page using the credentials that you supplied.

The rights are the same that on our production environment and it's working fine in production.

Does anybody have an idea to solve this issue please.

Thank you,

Nicolas

Like 0

Like

2 comments

Dear Nicolas, 

 

403 error means that you are not passing all needed authentication cookies and headers in the request. Please make sure that you are calling Auth service with correct credentials and that you use all necessary cookies and headers that you receive from the response(.ASPXAUTH, BPMCSRF): 

https://academy.creatio.com/documents/technic-sdk/7-16/authentication-external-requests

https://academy.creatio.com/documents/technic-sdk/7-16/executing-odata-queries-using-fiddler

 

Best regards, 

Dennis 

Thank you Denis,

 

You are right, so i will check my functions.

 

Have a nice day

Show all comments

Hello team,

We are encountering the following exception while dealing with UserConnection.

System.ServiceModel.ServiceActivationException: Set AspNetCompatibilityEnabled true

   at Terrasoft.Web.Common.BaseService.get_UserConnection()

   at Terrasoft.Configuration.UsrDeliqDBEntry.UsrdeliqDBEntry.d__7.MoveNext()

Could you please let us know if we are missing anything?

[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class UsrdeliqDBEntry : BaseService
{
 
 	private readonly UsrLogger usrLogger = UsrLogger.Instance;
    private Guid transRefId { get; set; }
    Guid intendedUserId= Guid.Empty;
 
 
		[OperationContract]
       [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = 
 WebMessageBodyStyle.Wrapped,
       ResponseFormat = WebMessageFormat.Json)]
		public async Task<string> saveCheckIndatabase(string documentId, string documentType, string customerId, Guid transRefId, Guid currentUserId)
        {
         var logger = global::Common.Logging.LogManager.GetLogger("MyLogger");
 
       try
       {var intendedUserSelect= new Select(UserConnection)
                 							 .Column("Id")
                 							 .From("SysAdminUnit")
                 							 .Where("ContactId").IsEqual(Column.Parameter(currentUserId))
                                 			  as Select;
            intendedUserId = intendedUserSelect.ExecuteScalar<Guid>();
       }
       catch(Exception e)
       {
       	logger.Info("Exception ="+ e.ToString());
       }

 

Like 0

Like

3 comments

Hello Shivani,

 

Please see this community post https://community.creatio.com/questions/generate-and-send-printable-email-started-timer where the same problem was discussed. 

 

Best regards,

Oscar

Oscar Dylan,

Looks like my case is different. How do I get UserConnection in a source code schema which is being called from another webservice configuration?

Shivani Lakshman,

 

Judging from your last comment you are calling this method, not like a web service but rather like a regular method of the class. Such an issue occurs when you are trying to obtain UserConnection in the code that runs in the background (in case of the article that Oscar has sent previously it happens because after timer element the process is executed in the background). You can try to pass userConnection to the method itself from where you call it. Also, you can try getting userConnection in the following way: 

private SystemUserConnection _systemUserConnection;
        private SystemUserConnection SystemUserConnection
        {
            get
            {
                return _systemUserConnection ?? (_systemUserConnection = (SystemUserConnection) AppConnection.SystemUserConnection);
            }
        }

 

 

Best regards, 

Dennis 

Show all comments

Hi. I am using C# decimal functions such as Math.Abs, Math.Round, etc. in a method on a page edit module, but it is not accepted. why is that?

Like 1

Like

4 comments

Dear Ricardo,

 

In order to use the static “Math” class in C# code you should add the “System” namespace to the file:

 

using System;

 

If the issue still exists, please provide us with a source code of the module and the error message. It will help us to analyze the issue in more details.

 

Additionally, please find more information about the “Math” class in the article by the link below:

 

https://docs.microsoft.com/en-us/dotnet/api/system.math?view=netcore-3.1

 

Best regards,

Norton

Norton Lingard,

Thanks for your prompt reply.

the code follows.

Where exactly in the code should I insert "using System; " ?

 

+++++++++++++++++++++++

define("FinJournal1Page", [], function() {

    return {

        entitySchemaName: "FinJournal",

        attributes: {

            "FinJrnNetAmount": {

                dataValueType: Terrasoft.DataValueType.FLOAT,

                dependencies: [

                    {

                        columns: ["FinJrnAmount"],

                        methodName: "calculateNetValue"

                    }

                ]

            }

        },

        modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,

        details: /**SCHEMA_DETAILS*/{

            ...

        }/**SCHEMA_DETAILS*/,

        businessRules: /**SCHEMA_BUSINESS_RULES*/{

            ... 

        }/**SCHEMA_BUSINESS_RULES*/,

        methods: {

            onEntityInitialized: function() {

                // Method parent implementation is called.

                    this.callParent(arguments);

                    this.calculateNetValue();

            },

                

                calculateNetValue: function() {

                //

                // MATH USE EXAMPLE

                //

                var amount = this.get("FinJrnAmount");

                if (!amount) {

                    amount = 0;

                }

                var absAmount = Math.Abs(amount) ;

                result = Math.Round(absAmount * 0.015, 2);

                this.set("FinJrnNetAmount", result);

            }

        },

        dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,

        diff: /**SCHEMA_DIFF*/[

            ...

        ]/**SCHEMA_DIFF*/

    };

});

+++++++++++++++++++++++

Best Regards,

Dear Ricardo,

 

It is impossible to use C# code inside JS code. Please note that it exists similar “Math” object in JS language. Please find more information about it in the article by the link below:

 

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math

 

 Best regards,

Norton

Working fine now . Thanks

Show all comments

Recently, in Creatio version 7.14.3.1686, we are encountering the error "TypeError: ProcessModuleUtilities.executeProcess is not a function". The code implementation regarding  "Cancel" button for Activity related tasks was done a month ago and was working perfectly fine, now I happen to see this error at the code "UsrActivityDashboardModel" attached here as text file. Though this was working fine until yesterday, I am getting the type error today. Kindly help me debug the same. We have implemented the same in our client environments and some of the env started throwing this error.

 

DB: oracle 12.1.0

Creatio : 7.14.3.1686

Like 0

Like

3 comments

Hello Dharini, 



 

First of all I have another error when I switched to not debug mode, and the cause of this error also could be a reason of your error (in debug mode all works properly).



Apart from that, you have some wrong dependencies in schema UsrActivityDashboardModel, you should replace EntityDashboardItemViewModel with ActivityDashboardItemViewModel 

Also you can replace

ProcessModuleUtilities.executeProcess(args);

with

ProcessModuleUtilities.runProcess("UsrCancelButtonBP",

{ RecordId: IdParameter } ,callback, scope);

Where callback - is a function which will execute after a process completion (you can specify Terrasoft.emptyFn), scope parameter is the scope in which callback will execute (usually this).



Kind regards,

Roman

Roman Brown,

I require help regarding the implementation of callback,scope. My code is as follows,

OnRejectButtonClick: function() {

                 this.console.log("Reject Button..");

                this.console.log(this.get("Id"));

                var IdParameter = this.get("Id");

                var args = {

                    sysProcessName: "UsrCancelButtonBP",

                    parameters: {

                        RecordId: IdParameter

                    }

                };

                ProcessModuleUtilities.executeProcess(args);

            },

Also I would like to know why ProcessModuleUtilities.executeProcess(args) is not working though I have added the dependencies related to ProcessModuleUtilities. Could you please provide an insight on this? 

 

define("UsrActivityDashboardModel",["ActivityDashboardItemViewModel", "ActivityDashboardItemViewModelResources", "ProcessModuleUtilities",
        "ConfigurationConstants", "MiniPageUtilities"],
    function(resources, ProcessModuleUtilities, ConfigurationConstants) {
        Ext.define("Terrasoft.configuration.UsrActivityDashboardModel", {
            extend: "Terrasoft.ActivityDashboardItemViewModel",
            alternateClassName: "Terrasoft.UsrActivityDashboardModel",
            entitySchemaName : "Activity",
 
            Ext: null,
            sandbox: null,
            Terrasoft: null,
 
 
 
            columns: {
                /**
                 * Process element identifier.
                 */
                "ProcessElementId": {
                    type: Terrasoft.ViewModelColumnType.ENTITY_COLUMN,
                    dataValueType: Terrasoft.DataValueType.STRING
                },
                /**
                 * Indicates if button "Execute" was clicked.
                 */
                "ExecuteButtonClick": {
                    type: Terrasoft.ViewModelColumnType.ENTITY_COLUMN,
                    dataValueType: Terrasoft.DataValueType.BOOLEAN
                },
                "RejectButtonClick": {
                    type: Terrasoft.ViewModelColumnType.ENTITY_COLUMN,
                    dataValueType: Terrasoft.DataValueType.BOOLEAN
                }
            },
 
 
 
            /**
             * @inheritdoc Terrasoft.BaseDashboardItemViewModel#initIconSrc
             * @overridden
             */
            initIconSrc: function() {
                var iconSrc = resources.localizableImages.IconImage;
                this.set("IconSrc", iconSrc);
            },
 
 
 
            /**
             * @inheritdoc Terrasoft.EntityDashboardItemViewModel#addQueryColumns
             * @overridden
             */
            addQueryColumns: function(esq) {
                this.callParent(arguments);
                esq.addColumn("Title", "Caption");
                esq.addColumn("Type");
                esq.addColumn("StartDate", "Date");
                esq.addColumn("Owner.Name", "Owner");
                esq.addColumn("ProcessElementId");
            },
 
 
 
            /**
             * @inheritdoc Terrasoft.BaseDashboardItemViewModel#getProcessElementUId
             * @overridden
             */
            getProcessElementUId: function() {
                return this.get("ProcessElementId");
            },
 
 
 
            /**
             * @inheritdoc Terrasoft.BaseDashboardItemViewModel#execute
             * @overridden
             */
            execute: function(options) {
                var elementUId = this.get("ProcessElementId");
                var recordId = this.get("Id");
                var schemaName = this.get("EntitySchemaName");
                if (!this._isEmailActivity() &amp;&amp; this.isActivity() &amp;&amp; this.hasMiniPage(schemaName)) {
                    this.showMiniPage(options);
                    return;
                }
                var config = {
                    procElUId: elementUId,
                    recordId: recordId,
                    scope: this,
                    parentMethodArguments: arguments,
                    parentMethod: this.getParentMethod()
                };
                if (ProcessModuleUtilities.tryShowProcessCard.call(this, config)) {
                    return;
                }
                this.callParent(arguments);
            },
 
 
 
            /**
             * Returns true if it is task activity entity.
             * @private
             * @return {Boolean} True if it is task activity entity.
             */
            isActivity: function() {
                var executionData = this.get("ExecutionData");
                var schemaName = this.get("EntitySchemaName");
                return this.Ext.isEmpty(executionData) ||
                    (executionData &amp;&amp; schemaName === executionData.entitySchemaName);
            },
 
            ////TODO #CRM-33987
            /**
             * Returns if current activity is email.
             * @returns {Boolean} Returns if current activity is email.
             */
            _isEmailActivity: function() {
                var activityTypes = ConfigurationConstants.Activity.Type;
                var typeLookup = this.get("Type");
                return typeLookup.value === activityTypes.Email;
            },
 
 
 
            /**
             * @inheritdoc Terrasoft.BaseDashboardItemViewModel#onExecuteButtonClick
             * @overridden
             */
            onExecuteButtonClick: function() {
                this.set("ExecuteButtonClick", true);
                this.callParent(arguments);
            },
 
            OnRejectButtonClick: function() {
            	 this.console.log("Reject Button..");
				this.console.log(this.get("Id"));
				var IdParameter = this.get("Id");
				var args = {
                    sysProcessName: "UsrCancelButtonBP",
                    parameters: {
                        RecordId: IdParameter
                    }
                };
                ProcessModuleUtilities.executeProcess(args);
			},
 
            /**
             * @inheritdoc Terrasoft.BaseDashboardItemViewModel#onCaptionClick
             * @overridden
             */
            onCaptionClick: function() {
                this.set("ExecuteButtonClick", false);
                this.callParent(arguments);
            },
 
 
 
            /**
             * @inheritdoc Terrasoft.MiniPageUtilities#openMiniPage
             * @overridden
             */
            openMiniPage: function(config) {
                if (this.get("ExecuteButtonClick")) {
                    var status = {
                        name: "ActivityMiniPageStatus",
                        value: "Done"
                    };
                    if (config &amp;&amp; this.Ext.isArray(config.valuePairs)) {
                        config.valuePairs.push(status);
                    } else {
                        config.valuePairs = [status];
                    }
                }
                this.callParent(arguments);
            }
        });
    });

 

Show all comments

While updating from repository in my local instance, I am getting the following error,

 

Error

An error has occurred when working with the repository

Failed to run the WC DB work queue associated with '\xxxxxxxxxxxxxxx', work item 23955 (file-install Schemas/UsrBPMCustomerOppurtunity/UsrBPMCustomerOppurtunity.cs 1 0 1 1)

SvnErrorCode: SVN_ERR_WC_BAD_ADM_LOG

RootCause: The system cannot find the path specified.

 

But there were no changes made to repository or repository path. Kindly help me with the above issue.

 

DB: Oracle 12.1.0

SVN: Visual SVN server with Tortoise SVN client

Like 0

Like

9 comments

 

 

Grigoriy,

I have a doubt regarding the commands -

delete from work_queue and svn clean up 

Could you please clarify whether running these commands will clean all work queues related to other SVN projects because there are several other projects running in the SVN server and clearing the work queue will create problems.

Hello!

 

1. You should export local changes to .md files (if there are any)

https://academy.creatio.com/documents/technic-sdk/7-16/schema-export-and-import

2. Click the "Restore from repository" button. Note, this step will revert all local changes not committed to the repository.

 

Please, let us know in case any further information is required. 

 

Best regards,

Olga. 

Olga Avis,

I have problem connecting to SVN repository so "Restore from repository" did not work. I tried this as a first step and then writing here seeking help.

I need help in how to do an SVN clean up with Visual SVN Server. I could not locate the .svn\wc.db as given in the post https://stackoverflow.com/questions/22362823/failed-to-run-the-wc-db-work-queue-associated-with-file

DhariniS,

 

The issue can be connected to the SVN repository itself.  Could you please try to use Tortoise SVN cleanup

If a Subversion command cannot complete successfully, perhaps due to server problems, your working copy can be left in an inconsistent state. In that case you need to use TortoiseSVN → Cleanup on the folder. It is a good idea to do this at the top level of the working copy.

 

Please, let us know in case it does not help you. 

 

Best regards,

Olga. 

Olga Avis,

Even after doing TotoiseSVN -> Cleanup on the folder (after check out from SVN), I am still getting the same error.

Please help.

Dear DhariniS,

 

Most probably, the issue is related to the authorization. Your saved authorization is stored by default in the C:\Windows\Temp folder, and files from there are sometimes lost. Please try changing the “sourceControlAuthPath” and “defPackagesWorkingCopyPath” parameters in ConnectionStrings on the path from where the data will not be lost (e.g., the booth folder itself). Please see the example below:

 

<add name="defPackagesWorkingCopyPath" connectionString="C:\inetpub\wwwroot\bpmOnline\Terrasoft.WebApp\Terrasoft.Configuration\Pkg" /> 

<add name="sourceControlAuthPath" connectionString="C:\inetpub\wwwroot\bpmOnline\Terrasoft.WebApp\svn" />

 

 

(The svn folder for the “sourceControlAuthPath” parameter must be created).

After that, log on to the storage through the configuration.

 

If the issue still exist, please try to find the local svn database for this package and clear the “WORK_QUEUE” table. The database is on the following path:

 

C:\Windows\Temp\<web-site number>\<IIS user>\Default\TerrasoftPackages\<Package>\.svn\wc.db.

 

Best regards,

Norton

Norton Lingard,

I tried the same but I am getting the following error on doing "Update from Repository",

 

Invalid descriptor: Could not find a part of the path 'C:\TESTUSER71\7.14.3.1686_SalesEnterprise_Marketing_ServiceEnterprise_Softkey_Oracle_ENU\Terrasoft.WebApp\Terrasoft.Configuration\Pkg\Safaricom_SFA_LeadToCash\Schemas\MobileAccountGridPageSettingsDefaultWorkplace\MobileAccountGridPageSettingsDefaultWorkplace.js'. Path: C:\TESTUSER71\7.14.3.1686_SalesEnterprise_Marketing_ServiceEnterprise_Softkey_Oracle_ENU\Terrasoft.WebApp\Terrasoft.Configuration\Pkg\Safaricom_SFA"

Attaching the screenshot here.

Dear DhariniS,

 

Unfortunately, it is difficult to determine the root cause of the issue without having an access to the instance and to the config files. Therefore, in order to resolve the issue please try to repeat all steps that were suggested in this post.

 

Best regards,

Norton

Show all comments

I am facing an issue in opportunities section where the case life cycle is not loading and in the console,  getting the error "Uncaught TypeError : type c is not a constructor". We have been facing the issue for a long time intermittently. Request help in resolving this.

 

Note: 

DB : Oracle Db 12.1.0

Creatio : Creatio Marketing,Sales,Services 7.14

Like 0

Like

4 comments

Dear Dharini, 

 

To find out the source of this issue please debug the application code to find on which code element the system tries to use "c" as a constructor: https://academy.creatio.com/documents/technic-sdk/7-16/client-code-debugging

 

Best regards,

Angela

Angela Reyes, 

Sure let me update here with the debug results.

 Hi Angela, while debuging I am getting the at the code attached here as screenshot

DhariniS,

We checked the result of debugging you provided and contacted our developer's team to provide you with a piece of advice about the issue you faced but unfortunately, it is quite hard to analyse this behaviour. We recommend you to contact Creatio Support team or your manager for advisory hours to receive more constructive suggestions about this particular error message. If you find more details during additional debugging feel free to share your results here. 

 

Best regards,

Angela

Show all comments

Hi All,

I've noticed something strange happening when notifications are created by a portal user and assigned to a Creatio user.

I've created a business Process, triggered when a lead is created in the Partner Portal by a Partner user. This process creates and assigns a notification to the partner manager. 

When a lead is created, the partner manager gets the indication he has a new notification, however when he checks the notification section no new notifications are present.

If the partner manager then triggers a process that creates a new notification assigned to itself (ex: Create Opportunity from Lead v7.8.0), a notification is created plus the previous expected notification is also shown.

Both notifications work fine and navigate to the correct record as expected. It feels like the issue is just with showing the notification. 

 

As anyone seen anything like it? 

 

Thanks,

Tiago

 

Like 0

Like

4 comments

How do you add a notification? Give the code or іschema process?

Hi Grigoriy, 

 

I created the following business process.

This process is triggered by a Portal user and creates a notification (step: Notify Partner Owner) assigned to the the partner owner, an internal user. 

I've copied the Step: notify Partner Owner from Business Process: Create Opportunity from Lead v7.8.0 > Step: Opportunity Notification. 

 

The Notification is created, just not shown until the Internal user triggers a process that creates a notification. 

 

 

 

Best regards,

Tiago

Tiago Carvalho,

Dear Tiago,

 

Can you please specify if the portal user can view notifications in notification panel? Or you expecting only popup?

 

Best regards,

Angela

Hi Angela,

 

The Portal user can't view notifications in the notification panel.

However the notification is addresses to the portal user manager (a company user) who can see the notifications. 

 

This user, see the warning that a there's a new notification. 

 

but when opening no new notification is shown. 

 

If this user triggers then triggers Business the Process: Create Opportunity from Lead v7.8.0. The process creates a new notification (Opportunities) and the previous hidden notifications are shown (Leads). 

 

I hope it makes sense.

 

Thanks,

Tiago

 

 

Show all comments

When I try to implement esq and multiple filters, only last added filter will work. Rest will be kind of overrided by the next filter.

For example, If I use 3 filters - 


esq.filters.add(esqFirstFilter);
esq.filters.add(esqSecondFilter);
esq.filters.add(esqThirdFilter);

I am getting results on the basis of last filter.

If I use 2 filters - 

 

esq.filters.add(esqFirstFilter);
esq.filters.add(esqSecondFilter);

 

Then last filter esqSecondFilter will filter the records not the first one. And I need both filters.

Is there anything need to be added to this code snippet - before or after.

 

Like 0

Like

1 comments

Dear Ramnath,

 

In order to resolve the issue please use the following code for adding filters:

 

esq.filters.add("esqFirstFilter", esqFirstFilter);

esq.filters.add("esqSecondFilter", esqSecondFilter);

 

Please find more information about esq filters in the article by the link below:

 

https://academy.creatio.com/documents/technic-sdk/7-16/entityschemaquery-class-filters-handling

 

Best regards,

Norton

Show all comments

Hi All,

 

I'm trying to add a new font to the text editor but without any success.  

I'm looking at System Settings CKEditor font list (and eventually at CKEditor default font).

I tried adding Calibri, Arial, Helvetica, sans-serif; to the system setting however it does not show in the list of fonts. 

Am I missing anything? 

Full value for CKEditor Font List: Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif;Calibri, Arial, Helvetica, sans-serif;

 

Thanks,

Tiago

Like 0

Like

4 comments
Best reply

Hello Tiago,

 

There will be two ways to use the created template for regular (not bulk) email sending:

 

1) from the "Actions dashboard" of some section (in this case the template will be available under the actions dashboard for the section that is specified as a macro source in the template settings and this template won't be available in the CTI panel). In this case we can select another font and type text using another font:

and then select the "Default" font from the list:

and continue using the default font for this template (that is my custom Tangerine font that I used during the template creation).

 

2) from the CTI panel and the behavior here is the similar to the behavior of the editor in actions dashboard.

 

Please also note that once you select the default font the "Open Sans" font will be displayed. This is a bug that our R&D team is aware of and I will also ask them to review this bug so they could fix it in one of nearest releases. I will also ask them to create some logic that allows using custom fonts in the email editor from the actions dashboard and in the CTI panel. 

 

You can also select all the text in the editor bedore sending an email and choosing the default font for the text so to prevent situations of two different fonts in the email text appearing.

 

Best regards,

Oscar

Hello Tiago,

 

There is no way to add a custom font to the list of fonts that appear when creating an email from the CTI panel. However you can add a custom font to the list of fonts in the content designer (this functionality was implemented in the 7.16.0 version). Please review this article where the whole process of adding a custom font is described and you will be able to use custom fonts in the content designer.

 

Best regards,

Oscar

Hi Oscar, 

 

Thanks for the reply, 

I've followed the article and the font is available for selection in the content designer. 

However, if the user wants to make changes to the selected email template there's the risk of the email being sent with two different fonts.  Would there be any way of preventing this? 

It would be useful to have the two list in sync.

 

Thanks,

Tiago

 

 

Hello Tiago,

 

There will be two ways to use the created template for regular (not bulk) email sending:

 

1) from the "Actions dashboard" of some section (in this case the template will be available under the actions dashboard for the section that is specified as a macro source in the template settings and this template won't be available in the CTI panel). In this case we can select another font and type text using another font:

and then select the "Default" font from the list:

and continue using the default font for this template (that is my custom Tangerine font that I used during the template creation).

 

2) from the CTI panel and the behavior here is the similar to the behavior of the editor in actions dashboard.

 

Please also note that once you select the default font the "Open Sans" font will be displayed. This is a bug that our R&D team is aware of and I will also ask them to review this bug so they could fix it in one of nearest releases. I will also ask them to create some logic that allows using custom fonts in the email editor from the actions dashboard and in the CTI panel. 

 

You can also select all the text in the editor bedore sending an email and choosing the default font for the text so to prevent situations of two different fonts in the email text appearing.

 

Best regards,

Oscar

Hi Oscar, 

 

Thanks for the explanation. 

 

Best regards,

Tiago

Show all comments

I am trying to implement validation logic in client module edit page of a section.

I want to save the column value of UsrAttributeName (a lookup) into a variable.

To do this, I am using this.get("UsrAttributeName").displayValue. But when Page is loaded it hangs and console shows the error 

message: Uncaught TypeError: Cannot read property 'displayValue' of undefined 

Like 0

Like

2 comments

Hello! 

 

1. To add validation use this.addColumnValidator method in setValidationConfig method.

Please, find the example in the Academy article: https://academy.creatio.com/documents/technic-sdk/7-16/how-add-field-va…

 

2. If the column value is not defined you cannot call for its properties. Check if the column has value:

var attribute =  this.get("UsrAttributeName");

var attributeDisplayValue = attribute  && attribute.displayValue;

 

Please, let us know in case any additional information is required. 

 

Best regards,

Olga. 

Olga Avis,

Hi 

 

After debugging it turns out undefined is coming because Entity/Page is not fully loaded or when I create a new record then all fields are empty.

I could use your suggested way to assign attribute value to a variable but that would not be able to work if entity/page is not fully loaded.

 

So I used a flag in attributes with default value false and set it to true in OnEntityIntilized method.

Then I checked the flag, if it is true then the validation method will run.

 

Thanks

Ram

Show all comments