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

Announcements

No record found.

News and Announcements icon
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.

  • Suggested answer
    GirishS Profile Picture
    27,845 Moderator on at

    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
    9,403 Super User 2026 Season 2 on at

    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
    308,274 Super User 2026 Season 2 on at

    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

    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
    308,274 Super User 2026 Season 2 on at

    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

    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

    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
    241,656 Most Valuable Professional on at

    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

    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
    241,656 Most Valuable Professional on at

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 239 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 221

#3
Subra Profile Picture

Subra 166 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans