web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Alternatives for removing a part of code from validate write d365fo, x++

(0) ShareShare
ReportReport
Posted on by

I want a particular condition to be not checked in validate write.I cant delete it so what method approach i can choose.please guide me.

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    You can't remove standard code. But you can always change the return value of methods, such as validateWrite. Be careful to not allow users to enter data that would break the standard functionalities. Remember that the standard functionalities trust that the data is complying with the standard validations.

    Normally you should use extensions to extend the solution = add your own features. Trying to remove standard features can lead to issues. Therefore I suggest that you share your actual scenario and business requirement with us, so that we can provide suggestions to you.

  • Community Member Profile Picture
    on at

    In validate write there is an if condition with checkfailed .My requirement is i want to skip that if condition.how can i achieve this or is there any other means of doing this so it should not throw an error. Table is Markup Table.In validate write there is an if condition as-

    if (this.VendType == MarkupType::LedgerAccount
    && this.CustType == MarkupType::Item
    && this.TaxItemGroup)
    {
    ok = checkFailed("@SYS26238");
    }

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    moved to the d365 forum

  • nmaenpaa Profile Picture
    101,160 Moderator on at

    As I already wrote: "I suggest that you share your actual scenario and business requirement with us, so that we can provide suggestions to you."

    So, what check is it? What table is it? Why do you want to bypass the check?

  • Johnkrish Profile Picture
    781 on at

    Hi sharudas,

    I would suggest you one solution. But it is about updating the record in the table.

    * After you added the extension class, inside the CoC method first you've to update your table record before calling next(), to make your condition false. Then 

    * After calling next() you can update your record again as per your requirement.

    ## By doing this you can avoid the execution of your IF condition.

  • Blue Wang Profile Picture
    on at

    Hi Sharudas,

    Duplicate thread:

    community.dynamics.com/.../alternatives-for-removing-a-part-of-code-from-validate-write-d365fo-x

    Answer in that  thread: Your requirement is disobeying with the extension design. we cannot by pass this if condition.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans