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

Notifications

Announcements

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 66

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)
  • Martin Dráb Profile Picture
    238,320 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.

  • 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.

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

News and Announcements

Season of Giving Solutions is Here!

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
Abhilash Warrier Profile Picture

Abhilash Warrier 843 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 288 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans