Skip to main content

Notifications

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.

  • Martin Dráb Profile Picture
    Martin Dráb 230,836 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?

  • Anoop B Profile Picture
    Anoop B 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
    Martin Dráb 230,836 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.

  • Suggested answer
    Anoop B Profile Picture
    Anoop B 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

  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 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.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,965 Super User 2025 Season 1 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.

  • Anoop B Profile Picture
    Anoop B 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
    André Arnaud de Cal... 291,965 Super User 2025 Season 1 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.

  • Deepak Agarwal Profile Picture
    Deepak Agarwal 8,564 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.

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 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.

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

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans