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

Community site session details

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

Is there any way to skip the error from the default code?

(0) ShareShare
ReportReport
Posted on by 30

8306.pastedimage1673243792302v1.png

I have a customization in this class where createFromAgreementLine will not have a value instead of that another buffer will have the data. Now my process is working fine, But while running the default class this point is throwing error. I have written all the logics before next call. Please anyone give me some idea to skip this.

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,825 Moderator on at
    RE: Is there any way to skip the error from the default code?

    Hi Anoop,

    There is no other way to bypass the standard validation unless you pass the values to createFromAgreementLine buffer.

    You must pass the buffer to createFromAgreementLine buffer to solve this error.

    Thanks,

    Girish S.

  • Deepak Agarwal Profile Picture
    8,585 on at
    RE: Is there any way to skip the error from the default code?

    Hi Anoop,

    createFromAgreementLine  is defined outside this method, check if you can get a buffer of this using any other method and pass the same into your code.

  • André Arnaud de Calavon Profile Picture
    300,095 Super User 2025 Season 2 on at
    RE: Is there any way to skip the error from the default code?

    Hi Anoop,

    There is another workaround. Instead of using the PurchAutoCreate_ReleaseFromAgreement, you can copy this class and call the new class from your process.

  • Anoop B Profile Picture
    30 on at
    RE: Is there any way to skip the error from the default code?

    Hi André Arnaud de Calavon,

    This PurchAutoCreate_ReleaseFromAgreement class is used in some other classes too while finding reference. If I am creating new class with same functionality, then I have to replace on those classes too right. I hope that will be huge process then.

  • André Arnaud de Calavon Profile Picture
    300,095 Super User 2025 Season 2 on at
    RE: Is there any way to skip the error from the default code?

    Hi Anoop,

    You are correct in your understanding. As I don't know your exact requirements, it was just a thought.

  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    RE: Is there any way to skip the error from the default code?

    Anyhow to execute your code the standard should run. The standard variable is giving error. As this buffer is not used now I guess it is not all used for your total development. But can you please confirm if this table buffer is not at all used anywhere and only your coc should be used? If yes, you can do in this way.

    This buffer is coming from some other method. As you said so if this buffer won't have value, then you can extend that method from where the present method is getting value and in that try assigning a value like 1 for that buffer rec I'd explicitly after next call as it won't have the buffer at all and not at all used anywhere. As it will have some value like 1 this validation would be skipped. But make sure it should not be used anywhere else.

  • Suggested answer
    Anoop B Profile Picture
    30 on at
    RE: Is there any way to skip the error from the default code?

    Hi All,

    I have solved that problem in another way by doing all the default process in the method which I am extending and at the end I just throw a info which is default message. I don't know weather its a correct practice or not but this worked for me and the process happening by the extended class is working perfectly. For sample, I have attached a image. If this should not be like this, Suggest your opinion.

    pastedimage1673932800400v1.pngpastedimage1673932806139v2.png

  • Martin Dráb Profile Picture
    236,960 Most Valuable Professional on at
    RE: Is there any way to skip the error from the default code?

    You shouldn't throw info and warnings.

    Also, it means that this logic will always fail when anyone calls it from inside a transaction, because it'll roll back the transaction.

  • Anoop B Profile Picture
    30 on at
    RE: Is there any way to skip the error from the default code?

    Hi Martin,

    I wrote this to be executed only if the default buffer don't have a value while executing. On this scenario also will it affect like what u said?

  • Martin Dráb Profile Picture
    236,960 Most Valuable Professional on at
    RE: Is there any way to skip the error from the default code?

    Hmm, how is a value of a variable related to whether the method is called inside a transaction or not?

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 580 Most Valuable Professional

#3
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 554

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans