Hi Community.

Here example validator client side in Documentary

/* Declare the AMD module. */

define("UsrAppValidators_FormPage", /**SCHEMA_DEPS*/[]/**SCHEMA_DEPS*/, function/**SCHEMA_ARGS*/()/**SCHEMA_ARGS*/ {

    return {

        viewConfigDiff: /**SCHEMA_VIEW_CONFIG_DIFF*/[

            {

                "operation": "insert",

                "name": "UsrName",

                "values": {

                    "layoutConfig": {

                        "column": 1,

                        "row": 1,

                        "colSpan": 1,

                        "rowSpan": 1

                    },

                    "type": "crt.Input",

                    "label": "$Resources.Strings.UsrName",

                    "control": "$UsrName"

                },

                "parentName": "LeftAreaProfileContainer",

                "propertyName": "items"

            }

        ]/**SCHEMA_VIEW_CONFIG_DIFF*/,

        viewModelConfigDiff: /**SCHEMA_VIEW_MODEL_CONFIG*/{

            "attributes": {

                "UsrName": {

                    "modelConfigDiff": {

                        "path": "PDS.UsrName"

                    },

                    "validators": {

                        /* Bind the custom validator to the attribute. */

                        "MyValidator": {

                            "type": "usr.MyValidator",

                            "params": {

                                "invalidName": "test",

                                "message": "Invalid name"

                            }

                        }

                    }

                },

                "Id": {

                    "modelConfigDiff": {

                        "path": "PDS.Id"

                    }

                }

            }

        }/**SCHEMA_VIEW_MODEL_CONFIG*/,

        modelConfigDiff: /**SCHEMA_MODEL_CONFIG*/{

            "dataSources": {

                "PDS": {

                    "type": "crt.EntityDataSource",

                    "config": {

                        "entitySchemaName": "UsrAppValidators"

                    }

                }

            }

        }/**SCHEMA_MODEL_CONFIG*/,

        handlers: /**SCHEMA_HANDLERS*/[]/**SCHEMA_HANDLERS*/,

        converters: /**SCHEMA_CONVERTERS*/{}/**SCHEMA_CONVERTERS*/,

        validators: /**SCHEMA_VALIDATORS*/{

            /* The validator type must contain a vendor prefix.

            Format the validator type in PascalCase. */

            "usr.MyValidator": {

                "validator": function (config) {

                    return function (control) {

                        return control.value !== config.invalidName ? null: {

                            "usr.MyValidator": { message: config.message }

                        };

                    };

                },

                "params": [

                    {

                        "name": "invalidName"

                    },

                    {

                        "name": "message"

                    }

                ],

                "async": false

            }

        }/**SCHEMA_VALIDATORS*/

    };

});



is it possible to give argument of validator (invalidName) dynamic from other field value instead static like "invalidName": "test"? or can field value (other than control) accessed inside validator method?

Like 0

Like

5 comments

As far as I know, this is not possible at the moment to get a value of other attributes in a validator.

Alex Zaslavsky,

Thanks for your answer, really appreciate it.

I was told by support that it currently isn't possible, and their recommended workaround was to save the value to the JS global variable `window`, the example they gave was:

viewModelConfig: /**SCHEMA_VIEW_MODEL_CONFIG*/{
"attributes": {                
    "DateTimeAttribute_lpcf566": {
        "modelConfig": {
            "path": "PDS.StartDate"
        },
        "change": {
            "request": "dw.StartDateChange",
        },
        "validators": {
            "StartDateIsNotNotLessThanProjectStartDate": {
                "type": "dw.StartDateIsNotNotLessThanProjectStartDate",
                "params": {
                    "message": "#ResourceString(StartDateIsNotNotLessThanProjectStartDateMessage)#",
                }
            }
        }
    },
}
},/**SCHEMA_VIEW_MODEL_CONFIG*/
handlers: /**SCHEMA_HANDLERS*/[
{
    request: "dw.StartDateChange",
    handler: async (request, next) => {
        /********/window.StartDate = await request.$context.DateTimeAttribute_lpcf566;/********/
        if(request.$context.IsStartDateInited) {
            request.$context.validate();
        }
        request.$context.IsStartDateInited = true;
        return next?.handle(request);
    }
}
],/**SCHEMA_HANDLERS*/
validators: /**SCHEMA_VALIDATORS*/{
"dw.StartDateIsNotNotLessThanProjectStartDate": {
    "validator": function (config) {
        return function (control) {
            return (!control.value || control.value >= /********/window.StartDate/********/)
                ? null
                : {"dw.StartDateValidator": {message: config.message}};
        };
    },
    "params": [
        {
            "name": "message"
        }
    ],
    "async": false
}
}/**SCHEMA_VALIDATORS*/

 

Where I've highlighted with surrounding comments the usage of the window to store this additional information to be used by the validator. Definitely not ideal, and hopefully they'll add this functionality in future, since async validators to perform some checks against the record when some field changes (and so where the validator will need the record's ID) seem to be the most useful usage of them, but this should at least work in the meantime.

M Khaerul Anwar,

 

Hi, Have you solved this and works?

 

I'm trying to implement on a similar situation using the provided code, but didn't understand from where is introduced/initialized IsStartDateInited  (request.$context.IsStartDateInited)?

 

Please could you help me?

 

Thanks

Julio Falcón

Julio.Falcon_Nodos,

No, I took a different approach from client-side to server-side validation instead.

Show all comments

Hello,

i'm trying to fix a script from an entity event, which used to work before Creatio 8,

i need to compile the entity that hold it but there is an error i can't figure out :

 

on this line : 

var IsChangedUsrFraisDePortHT = Entity.GetChangedColumnValues().Any(col => col.Name == "UsrFraisDePortHT");

 

i got that error message after publishing :

'IEnumerable<EntityColumnValue>' does not contain a definition for 'Any' 
and no accessible extension method 'Any' accepting a first argument of type 'IEnumerable<EntityColumnValue>' 
could be found (are you missing a using directive or an assembly reference?)  

 

how should i process please ?

 

Best regards

Patrice

Like 0

Like

2 comments

i maybe found a workaround with code from this page : https://customerfx.com/article/adding-code-to-listen-for-entity-events-…

Hi,

 

Verify that the assembly containing the Any extension method is referenced in your project.

Make sure the assembly package checkbox is not checked. It may need to be unchecked and rechecked to verify if the website compiles.

Show all comments

Hi Team,

 

I'm trying to show the path on a custom embedded map in creatio edit page using the below given code in the edit page of the section for the polyline encoded path. However, it shows no path or coordinates on the map in the edit page. Could anyone help?

 

Diff Block to insert map in the screen:

 

{
				"operation": "insert",
				"name": "GMaps",
				"values": {
					"itemType": 7,
					"id": "googleMap",
					"styles": {
						"height": "500px"
					},
					"items": []
				},
				"parentName": "LeftModulesContainer",
				"propertyName": "items",
				"index": 2
			},

 

 

 

Method 

initMap = function() {
    var map = new google.maps.Map(document.getElementById('googleMap'), {
        center: { lat: 28.4595, lng: 77.0266 },
        zoom: 8
    });
 
    // Polyline encoded string
    var encodedPolyline = "ic`i@ohqfN@A??????????????????????????????????????????????A????????L?HABAH@KEREDEDCJIFEJ??MFMHOHMFIFCF??EBC@ABC@AD@CIFEFCDEDCBCBBCEFC@?@A@A@@CCD?@ABABA@AD@CEFCBA@?@A@CB@AEFEBCDEDEDEF??EFEFGHAFGB@ACFCD?B?BABB?AA@@?AA?????????????????????@A???C@AA??A?@?D??A@?A????????????A@?A??@???A????@@??AA@@A?B?@?@@?A??@?????????????A?@???????????????????????????????A?@?AA??@???????A????@?????A?@?????A?????@A??????????????????????????????????????????????????????????????????????????????????????A?????A@??@AA@??????@@???A?@????????????????????????????????????????????????????????????ACA@??@?????A@?@A????A????ADABCDCDGLEJ??EJEHEJGJEL??ELELCNIJEJ??CJCFCHGHCHEH??EJGLIJMHKH??OHMFMFOFMFMF??KFKFMFOFMDOH??MHKJGJIPOPGH??KFKFG@EHED??GBEHCJGJEHEH??GHAFEBCBCDA??AE@?B?@A@CDAD@C?H???CAA?AA@@?A?A@???????????@?AA?@???????AA?????@?AABA@@?A??A??????????????A??@????@?A@A@CBCFCDGL??EDCDE@ABCF@CEH?DEDC@A?A?@AEHCDEDCLEH??EJEHGJIPGJIL??ELKNIJKLIHEP??EHEFCBADCBAB@CCDC@?@?@?@?AABA@??AA?AAA@@AA?AA???@@AA???????A???@?A?@?????????????A?@?@A?@A???????????????A??@???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????";
 
    // Decode polyline
    var decodedPath = google.maps.geometry.encoding.decodePath(encodedPolyline);
 
    // Create a polyline and set its path to the decoded path
    var polyline = new google.maps.Polyline({
        path: decodedPath,
        geodesic: true,
        strokeColor: '#FF0000',
        strokeOpacity: 1.0,
        strokeWeight: 20,
        map: map 
    });
};
 
$.ajax({
    url: "https://maps.googleapis.com/maps/api/js?key=APIkeyvalue&callback=initMap&libraries=geometry",
    dataType: "script"
});
{
				"operation": "insert",
				"name": "GMaps",
				"values": {
					"itemType": 7,
					"id": "googleMap",
					"styles": {
						"height": "500px"
					},
					"items": []
				},
				"parentName": "LeftModulesContainer",
				"propertyName": "items",
				"index": 2
			},

 

Many Thanks,

Sarika

Like 1

Like

4 comments

Hi Team,

 

Could anyone help, Please?

Maybe instead of referencing the map when creating the polyline, specifically add it after. After creating the polyline add: 

polyline.setMap(map);

🤷🏼‍♂️

Ryan

Hi Ryan,

 

Thanks for the response. Tried this but still not working.  

Sarika Sharma,

Might have better luck in a forum for the maps api or StackOverflow.

Ryan

Show all comments

hi everyone!

i have detail. I use MultiChoiceMixin.

but for selection of values lookup of my MultiChoiceMixin I need enter to data.

would you explain me how to choice from list of data without entering to data (see screen, red colomn I must fill).

 

 

File attachments
Like 0

Like

1 comments

Hello,

 

This addon with multi choice https://marketplace.creatio.com/app/multiple-choice-field-setup-creatio wasn't developed to be used in the list of a detail or in the section. The responsible DevLabs team was informed about this question in the community. We've registered a problem with developing this functionality to make it possible to use the multichoice column in the list.

 

Thank you for this idea and for helping us improve the app!

Show all comments

I have a script that collects a data set using:

 

var oppProdQuery = new EntitySchemaQuery(UserConnection.EntitySchemaManager,"OpportunityProduct");



On publish, this is throwing an error:

 

'FlowEngine' is obsolete: '7.17.3 | Class is not in use and will be removed in upcoming releases. Use IProcessExecutor (UserConnection.ProcessEngine.ProcessExecutor) to start the processes.'

 

Can you advise how to fix?

Like 0

Like

1 comments

Hello everyone,

I would like to calculate sales KPI and show them in dashboard like Last year to date, year to date sales, calculate the year to date difference and also made it also in percentage.

 

First I tried with a list and used pivot table to calculate these KPIs but I encounter a case wich if an account made an order this year but not the previous year, an error : divide by 0 occurs. I can't use any operators in the formula to avoid this case.

 

So I tried another solution by using the "calculated metrics" plugin to calculate the difference in sales since the beginning of the year and the difference in sales since the beginning of the last year as a percentage.

This works but the display is only in the form of metric values, is it possible to build a column dashboard with the metric data as input?

 

Can I create an object from my metric data and use it in a dashboard ?

Or even a function that takes order.account.owner as currentUser and returns the data?

Like 1

Like

1 comments

Hi,



 

Unfortunately, it is impossible to change the display of the dashboard from the Calculated metrics add-on using basic methods.

 

Regarding the "Divide by zero error encountered" error, to avoid this error, you can add +0.01 /(last year to date + 0.01) to the value by which the division is performed, but this will cause a slight difference in the calculations.

 

You can also add filtering to the Pivot table so that records with the value "last year to date" are not included in the list, so division by 0 will not occur and you will avoid the display error.

 

We have created a task for our development team to investigate and develop a mechanism to address this error in future versions of the application as the error occurs at the database level.

 

Thank you!

Show all comments

Hi Community,

In the OData4 protocol the maxTopLimit parameter

defines the limit for the value in the maximum number of rows in the output (which is 20.000 records)

We are retrieving the data from the Accounts table which has around 40.000 records.

What is the workaround or fix for this scenario?

Sasor

Like 0

Like

1 comments
Best reply

You can use the $top and $skip parameters to retrieve the data in pages. 

For example: 

Page 1 (first 1000)

https://creatiourl/0/odata/contacts?$top=1000&$skip=0

Page 2 (next 1000) 

https://creatiourl/0/odata/contacts?$top=1000&$skip=1000

Page 3 (next 1000) 

https://creatiourl/0/odata/contacts?$top=1000&$skip=2000

etc

Ryan

You can use the $top and $skip parameters to retrieve the data in pages. 

For example: 

Page 1 (first 1000)

https://creatiourl/0/odata/contacts?$top=1000&$skip=0

Page 2 (next 1000) 

https://creatiourl/0/odata/contacts?$top=1000&$skip=1000

Page 3 (next 1000) 

https://creatiourl/0/odata/contacts?$top=1000&$skip=2000

etc

Ryan

Show all comments

Hi

 

I have two buttons on the accounts page that appear fine except when navigating to page via Global Search, where one disappears.

 

Standard Record access

 

Access via Global search

 

 

Both buttons have same set up except one is right container and one is left.

 

Anyone know why this is happening and how to resolve it?

 

Like 0

Like

4 comments

Hello,

 

Please specify how exactly this button was implemented in your system.

It was created using Replacing view model. It works and displays fine unless you go into record via Global Search. The other button 'Supplier Approval' was created in same way and displays when viewing via global search. The pages are the same so it is strange.

Rob Watson,

 

are you sure that the "Compliance approval" button has its implementation in the section schema (the button is developed to be used in combined mode)?

Hi Oleg,

 

Yes the setup is the same as the 'supplier approval' which does show when accessing via Global Search, The only difference is that one is using combined right container and one is using combined left container

Show all comments

Does Creatio allow to sign outgoing e-mails with S/MIME?

Like 1

Like

2 comments

Hello,

 

Unfortunately, at the moment, there is no mechanism for signing outgoing emails in Creatio.

 

We have registered the request for our development team to evaluate the possibility of implementing such a mechanism in future releases of the application.

 

Thank you for helping us make our product better!

Best regards,

Pavlo.

Thank you for the reply :)

Show all comments

Hi all,

 

Could someone please kindly advise:

1. "Timestamp" for Stages similar to Stage in Opportunity Section. 

2. How to measure Interval duration for each stage

 

Many thanks

Mid

Like 0

Like

1 comments

Hello Mid,

 

We have consulted with our colleagues from the R&D team regarding your case.

Unfortunately, there is no such option. Apart from that, its implementation would require development tools. 



For example, 

The necessary logic according to your business task is implemented on the coreb part "Case Lifecycle" and you can build on the work of this part when developing.



The implementation of CaseLifecycle filling method can be observed in the event process (CaseSaving and CaseSaved) of the Case object from the SLM package.

CaseLifecycle filling method - SaveLifecycle().



To implement the logic, you will need to create two objects - Usr[ObjectName] stages and Usr[ObjectName]history, on the basis of which the detail will be created.



We will also create a case for our R&D team on this matter so it may be implemented in the next releases.

Show all comments