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

which class is the best way to debug which code handle form load ?

(0) ShareShare
ReportReport
Posted on by 596

Hi guys,

I activated Subscription Billing feature, and in Sales Order, in the Line action pane section there is a button labeled "Deferrals"

when clicked it will pop up window for Deferral's process.->

I want to modified this setting to make some default. Question is how to know which class I need to modified ? What or how is the best way to know where is the handling when form is loaded, because I think I need to modified right before the form is displayed.

I tried to create Event Handler class, in the form "SubBillDeferralTransactionDeferral", I believe this is the pop up form, event handler in their "SubBillDeferralTransactionDeferral_OnInitialized", just adding "info("hi")" and put a breakpoint, but seems it is not the right place since I cannot see of what other class or function makes the value.

I actually beginner on this development, may need some guidance of what is the best way to identify this in D365 FO development.

Thanks, 

I have the same question (0)
  • Voltes Profile Picture
    596 on at
    RE: which class is the best way to debug which code handle form load ?

    In the form itself "SubBillDeferralTransactionLineDeferral", there is void called "initFromSalesLine". I thought this is the code which handling the defaulting value. I put some breakpoint in it, however it is not stopped when I'm doing debug.

    Anyway, I'm asking how "in general" is the best way and practical way (and fastest way) to know this kind of thing in D365 F&O development, if my question is too specific.

    Thanks

  • Mohit Rampal Profile Picture
    12,565 Moderator on at
    RE: which class is the best way to debug which code handle form load ?

    Hi, SubBillDeferralTransactionDeferral seems to be correct form that is called from Deferrals button. You can add breakpoint in init method of this form.

  • Voltes Profile Picture
    596 on at
    RE: which class is the best way to debug which code handle form load ?

    Hi Mohit,

    Thanks,

    I actually already put breakpoint on that Init() method, however it won't stop when debugging. then the form just come out as it is.

    pastedimage1684821726105v2.png

    I also put another breakpoint in that Switch case, there is one case which is the case is SalesLine ->

    pastedimage1684821836884v3.png

    Also as mentioned, debug not stopped, so I cannot determine what to create in order to modified the default value of the form before it is finish loading.

    Just for example, I want to make the Deferred value to always "Yes"

    Anyway I need to find out the call stack first, which currently I didn't know because the debug won't stop at the given breakpoint.

    Thanks

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at
    RE: which class is the best way to debug which code handle form load ?

    You can try creating Event Handler or CoC on OnInitialized method of this form and set default value in the Deferral parameter. If you want this for Sales orders only then just li.ke standard code, you can check if its for SalesLine.

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 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans