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, ...
Unanswered

FORM init D365 extension logic

(0) ShareShare
ReportReport
Posted on by 68

Hi,

Lets suppose we have a STANDARD Form 'ABC' having multiple datasources say dsA,dsB,dsC.

Now in dsB there is below code written,

public void init()
{

String hello = ordertype ::sales;
QueryBuildDataSource qbds;

super();

lots of logic executed based on hello.(lets say line 10-lin 20)

qbds = hello etc...

}

My requirement is to set the value of hello to purchase in case it is being called from a Purchase menu item.

The form datasouce COC wont help because the  line 10-line 20 will have already executed.

Also the event handler of initialized might not work in this case...
So is there a way to handle this logic .
I dont think so there is initializing for init of datasouce.

Thanks,

VM

I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Vicky,

    You can place your logic before the next call in the CoC so that your logic is executed before the other lines of the standard code. You can check for the caller menu item and set the value accordingly.

  • Martin Dráb Profile Picture
    238,769 Most Valuable Professional on at

    No extension allows you to access local variables such as hello.

    Consider letting the method run and then re-apply some parts of it with the different type of hello.

    If you don't see any way how to extend the code, log an extensibility request.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 514 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 390

#3
Adis Profile Picture

Adis 266 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans