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

Can I navigate to the Detail Master part of a form from the Grid part?

(1) ShareShare
ReportReport
Posted on by 343
I have the following extension:
 
[ExtensionOf(formDatasourceStr(EcoResProductDetailsExtended, InventTable))]
public final class FormDS_EcoResProductDetailsExtended_InventTable_Extension
{
    public void executeQuery()
    {
        this.executeQuery_post();
        next executeQuery();
    }
    public void executeQuery_post()
    {
        FormDataSource fds = any2Object(this) as FormDataSource;
        FormRun formRun = fds.formRun();
        FormStringControl strControl =  formRun.control(formRun.controlId(formControlStr(EcoResProductDetailsExtended, BarcodeQuickFilter)));
        str searchTerm = strControl.valueStr();
 
        Args    args;
        FormRun newFormRun;
        InventTable inventTable;
        InventItemBarcode searchedItemBarcode;
        select firstonly RecId from searchedItemBarcode where searchedItemBarcode.ItemBarCode == searchTerm
            join * from InventTable where InventTable.itemId == searchedItemBarcode.ItemId;
       
        if(InventTable.itemId)
        {
            args = new Args();
            args.record(inventTable);
            newFormRun = new menufunction(menuItemDisplayStr(EcoResProductDetailsExtendedGrid), MenuItemType::Display).create(args);
            
            newFormRun.init();
            newFormRun.run();
            newFormRun.wait();
        }
 
When it hits the line where the menufunction is added to the newFormRun variable, I get the error:
A control with the name 'NavigationListQuickFilter' already exists on the form.
1. Is this because I am calling this menu item while I am already at this form? 
2. If so, is there a simpler way to just redirect my form to the detail part or the relevant itemId?
  • André Arnaud de Calavon Profile Picture
    307,097 Super User 2026 Season 2 on at
    Hi Superbunny,
     
    Can you explain what exactly you want to achieve? What exactly do you mean by "redirect my form to detail part" and what is "the relevant idemId"?
  • Superbunny Profile Picture
    343 on at
    @André:
     
    Hello,
     
    What I would like to achieve is to navigate to the detail part of this form.
    (by Master part I mean where you enter and see the grid with all the records. By Detail part I mean what you see if you click on a single record).
     
    I figured so far that the error regarding the navigation control is due to me calling newFormRun.init. Since I navigate to the same form which I already was on, I figured this might cause issues. And removing the init call resolved my issue.
     
    I also tried to call the following logic, after navigating to newFormRun:
     
    FormTabControl ftc = element.design().controlName(formControlStr(EcoResProductDetailsExtended, Details)) as FormTabControl;
    ftc.setFocus();
     
    (Details is the element I want to move the view too, but this line of code also did not work)
     
     
    By relevant ItemId I meant with data filtered for the found ItemId. This however works, as passing the record along via args works fine and now the view filters correctly. The problem that remains is that it navigates to the grid AKA master form part and I still cant move the view to the details part.
  • Verified answer
    André Arnaud de Calavon Profile Picture
    307,097 Super User 2026 Season 2 on at
    Hi Superbunny.
     
    There is a method available for menu functions called formViewOption. Before the run() method you can add the next statement and check if that solves your challenge.
    newFormRun.formViewOption(FormViewOption::Details);
     
     
  • Waed Ayyad Profile Picture
    9,218 Super User 2026 Season 2 on at
    Hi,

    Is your issue resolved?  If yes, mark the answers that helped you as verified.

    Thanks
    Waed Ayyad
  • Superbunny Profile Picture
    343 on at
    @Andre: Yes, that is exactly what I was looking for :) thanks!
  • Superbunny Profile Picture
    343 on at
    Please note that I have been trying to accept the answer, but each time I do the request times out
  • André Arnaud de Calavon Profile Picture
    307,097 Super User 2026 Season 2 on at
    Hi Superbunny,

    Thanks for your reply. I tried marking the reply as moderator. It now worked. In case you have this issue again with a next question, please use the Community support option as part of the Resources menu on this site.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 415 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 374

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 365 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans