Skip to main content

Notifications

Announcements

No record found.

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 64

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

  • Martin Dráb Profile Picture
    233,013 Most Valuable Professional on at
    RE: FORM init D365 extension logic

    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,421 on at
    RE: FORM init D365 extension logic

    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

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,013 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans