Skip to main content

Notifications

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 592

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, 

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 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.

  • Voltes Profile Picture
    Voltes 592 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

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 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
    Voltes 592 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

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…

Vahid Ghafarpour – Community Spotlight

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

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,074 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,900 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans