How to Skip/Bypass standard validation in contract class.
Example: I have HcmBirthdayContract class
I have to Skip/Bypass the validate method logic and write own custom logic.
Thanks in advance.
How to Skip/Bypass standard validation in contract class.
Example: I have HcmBirthdayContract class
I have to Skip/Bypass the validate method logic and write own custom logic.
Thanks in advance.
Thanks Sergei Minozhenko And QianQW,
Your approaches are worked for me, Thanks a lot.
Hi SarathVarma,
You could use COC method to bypass the validate method like this :
{
boolean ret = next validate();
ret = true;
//your logic…… return ret1.
return ret&&ret1;
}
Hope this helps.
Regards,
QianQW
Hi SarathVarma,
In this case, you can still use CoC and add your logic after "next" statement and return true or false based on your logic. But be very careful with this approach, as bypassing standard validation can cause data corruption or/and unpredictable behavior. However, for reports, it should be quite safe. Also, you can clean infolog to avoid showing to user misleading error from standard validation.
Actually I have the similar requirement where I have to skip the standard validation which throws error by using checkFaikled()in validate method of report contract class
Hi SarathVarma,
I suggest you create CoC method and put your new logic before next call. There is no point to skip standard validation (date comparison), and if you need to put another default values to the dates it will work if you just do it before standard code executes.
Thanks for the quick response.
Yes, there is some more new logic to be implemented instead of existing.
Hi SarathVarma,
Do you really need to bypass standard validation logic in this class? It just compares provided dates and nothing more. Or do you want to change default dates is there are empty?
André Arnaud de Cal...
293,129
Super User 2025 Season 1
Martin Dráb
231,895
Most Valuable Professional
nmaenpaa
101,156
Moderator