Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to Skip/Bypass standard validation in contract class

(0) ShareShare
ReportReport
Posted on by 122

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.

  • Suggested answer
    SarathVarma Profile Picture
    122 on at
    RE: How to Skip/Bypass standard validation in contract class

    Thanks Sergei Minozhenko And QianQW,

    Your approaches are worked for me, Thanks a lot.

  • Verified answer
    qianwang Profile Picture
    7,153 on at
    RE: How to Skip/Bypass standard validation in contract class

    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

  • Verified answer
    Sergei Minozhenko Profile Picture
    23,091 on at
    RE: How to Skip/Bypass standard validation in contract class

    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.

    omni365.wordpress.com/.../

  • SarathVarma Profile Picture
    122 on at
    RE: How to Skip/Bypass standard validation in contract class

    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

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,091 on at
    RE: How to Skip/Bypass standard validation in 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.

  • SarathVarma Profile Picture
    122 on at
    RE: How to Skip/Bypass standard validation in contract class

    Thanks for the quick response.

    Yes, there is some more new logic to be implemented instead of existing.

  • Sergei Minozhenko Profile Picture
    23,091 on at
    RE: How to Skip/Bypass standard validation in contract class

    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?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,129 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,895 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans