Notifications
Announcements
No record found.
Hi,
how can I find which grid is currently active?
I've created a form with 4 grid every grid has a differend datasource.
I need to make a call based on the datasource of the active grid but how can I find which one is surrently running?
Hi RadekM,
Please go through the blog about Loop through selected records in the grid with the multi-select helper class to get the active grid:
d365ffo.com/.../
I don't see it would help me here. User can have selected records on all grids at once since they don't unselect while switching between grids.
I did find something like this but I cant get it on working or how should I really declare it...
FormTabPageControl activeTabPage = DocumentHistoryMainTab.getActivePage();
activeTabPage.caption();
You need set tab's autoDeclaration property to YES (Offcourse you need a tab and tabPages for each grid)
Edit: I've never used this structure in 365, it may have been changed or completely removed. I've shared a similar approach below.
community.dynamics.com/.../formactionpanetabcontrol-in-d365
For this one I think you can user the cursor of the record to get the current record in the active grid then check for the type of that records or even get the DS name directly and create your own condition.
You might use cursor and then datasource method of the called form to get the active records and ds.
Hope this will help.
Regards,
I've got one more question related to this topic.
How can I manipulate the button properties on my form? Most of the methods I override dont recognize the autodeclared names of my buttons.
So I end up doing something like below but there is still a problem that when the form runs on the default row I can always use the button.
[Control("Tab")] class DocumentHistoryMainTab { public void tabChanged(int _FromTab, int _ToTab) { super(_FromTab, _ToTab); FormTabPageControl tabPageControl = DocumentHistoryMainTab.getActivePage(); pageName = tabPageControl.caption(); } } [DataSource] class DocumentHistoryInvoice { public int active() { int ret; ret = super(); ShowFile.enabled(true); if(pageName != '@SM:SM00259') { ShowFile.enabled(false); } return ret; } }
You can set first value via form control's property or you can set value with code at form's init method (form will opened with default tabPage so you can set first value )
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Abhilash Warrier 669 Super User 2025 Season 2
André Arnaud de Cal... 449 Super User 2025 Season 2
Martin Dráb 384 Most Valuable Professional