Hide invalid communication options

Hi Team, 

 

Anybody know how to hide the invalid communication option on the page? I tied to find the data source and filter without success. 

 

Thanks,

Like 0

Like

2 comments

Hello,
 

Thank you for your question! You can achieve this goal by developing at the client module level. You need to define a static filter in the viewModelConfigDiff block.
 

Here's an example of such a filter to cut off the display of data that has the invalid attribute (at the ContactCommunication table level, this is the NonActual = true column) on Contact Form Page
 

 

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

    return {

        viewConfigDiff: /**SCHEMA_VIEW_CONFIG_DIFF*/[]/**SCHEMA_VIEW_CONFIG_DIFF*/,

        viewModelConfigDiff: /**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/[

            {

                "operation": "merge",

                "path": [

                    "attributes"

                ],

                "values": {

                    "ContactCommunicationOptionsItems": {

                        "isCollection": true,

                        "modelConfig": {

                            "filterAttributes": [

                                {

                                    "loadOnChange": true,

                                    "name": "ContactCommunicationOptions_ABCD_PredefinedFilter"

                                }

                            ]

                        },

                    },

                    "ContactCommunicationOptions_ABCD_PredefinedFilter": {

                        "value": {

                            "items": {

                                "Hide_NonActual_160e9787-e4f3-4eee-88b7-60e7b57e2b32": {

                                    "filterType": 1,

                                    "comparisonType": 3,

                                    "isEnabled": true,

                                    "trimDateTimeParameterToDate": false,

                                    "leftExpression": {

                                        "expressionType": 0,

                                        "columnPath": "NonActual"

                                    },

                                    "isAggregative": false,

                                    "dataValueType": 12,

                                    "rightExpression": {

                                        "expressionType": 2,

                                        "parameter": {

                                            "dataValueType": 12,

                                            "value": false

                                        }

                                    }

                                }

                            },

                            "logicalOperation": 0,

                            "isEnabled": true,

                            "filterType": 6,

                            "rootSchemaName": "ContactCommunication"

                        }

                    }

                }

            }

        ]/**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/,

        modelConfigDiff: /**SCHEMA_MODEL_CONFIG_DIFF*/[]/**SCHEMA_MODEL_CONFIG_DIFF*/,

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

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

        validators: /**SCHEMA_VALIDATORS*/{}/**SCHEMA_VALIDATORS*/

    };

});

Hi Serhii Parfentiev,

Thank you.  works perfect

   {
                "operation": "merge",
              "path": [
                    "attributes"
                ],
                "values": {
                    "ContactCommunicationOptionsItems": {
                        "isCollection": true,
                        "modelConfig": {
                            "filterAttributes": [
                                {
                                    "loadOnChange": true,
                                    "name": "ContactCommunicationOptions_OnlyActual_PredefinedFilter"
                                }
                            ]
                        },
                    },
                    "ContactCommunicationOptions_OnlyActual_PredefinedFilter": {
                        "value": {
                            "items": {
                                "Hide_NonActual_160e9787-e4f3-4eee-88b7-60e7b57e2b32": {
                                    "filterType": 1,
                                    "comparisonType": 3,
                                    "isEnabled": true,
                                    "trimDateTimeParameterToDate": false,
                                    "leftExpression": {
                                        "expressionType": 0,
                                        "columnPath": "NonActual"
                                    },
                                    "isAggregative": false,
                                    "dataValueType": 12,
                                    "rightExpression": {
                                        "expressionType": 2,
                                        "parameter": {
                                            "dataValueType": 12,
                                            "value": false
                                        }
                                    }
                                }
                            },
                            "logicalOperation": 0,
                            "isEnabled": true,
                            "filterType": 6,
                            "rootSchemaName": "ContactCommunication"
                        }
                    }
                }
            },
Show all comments