How to read the start date value to validate enddate value before saving a record

Hello Community,

 

I wanted to validate Start date and enddate. For start date I will use current date to validate. But to validate EndDate I wanted the value of Startdate field. 

I want to know how to read the startdate attribute value in the end date validator. 

I am able to get the value of the attribute in handler, But i could not get value in the validators

"usr.usrenddatevalidator":{

                "validator": function(config){

                    return function(control){

                        var date1 = new Date();

                        var date2 = new Date(control.value);

                        var date3 = startdateAttributeValue;

                        return (date2 < date1 || date3 >= date2) ?  {"usr.usrenddatevalidator": { message: config.message }} : null;

                    };

                },

                "params":[

                    {"name":"message"}

                   ],

                "async":false

            },

Thanks in Advance 

Gargeyi.G

 

Like 1

Like

3 comments

Hello Gargeyi,

 

Unfortunately there is no way to get data from other controls on the page in the context of validator execution triggered on some of the controls on the page. I've asked our core R&D team to add the possibility to operate with other controls values in terms of validator execution. Thank you for helping us in making the app better!

Oleg Drobina,

Thanks Oleg

 

I have the same issue, I saw this issue was from more than one year, I'm working on Creatio v8.1.3. Is still not possible to resolve what Gargeyi Gnanasekhar ask?

 

In my case I need to validate just when some conditions met regarding some data in the page, for example, the type of document is type1 or type2 or type 3.

 

Is there any workaround to accomplish this need?

 

Thanks in advance

Julio.Falcon_Nodos, hello!

I've checked the problem status, and it's in the process of being resolved. Follow the release updates to be the first to see the news.

Show all comments