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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Deep linking to a LedgerJournalTransVendPaym form

(0) ShareShare
ReportReport
Posted on by
I have a form that shows payment journals across all the legal entities - we are global and make payments from a range of legal entities. I would like to be able to link directly to the LedgerJournalTransVendPaym form for a specific Journal in an entity. I am stuck on how to link into the VendPaym form?
Categories:
I have the same question (0)
  • Suggested answer
    Shaluma Profile Picture
    137 on at
    Hi,

    Could you please refer the below URL,
    https://d365fotechexpert.blogspot.com/2023/09/generating-deep-links-for-d365-fo-forms.html

    Global legal entity
    The generator.Company property is what drives the entity switch. When you set it to the legal entity of that specific journal row, D365FO will open LedgerJournalTransVendPaym in that company's context automatically — no manual company switching needed.

    using Microsoft.Dynamics.AX.Framework.Utilities;
    
    public class VendPaymJournalDeepLink
    {
        /// <summary>
        /// Generates a deep link to LedgerJournalTransVendPaym
        /// for a specific journal in a specific legal entity.
        /// </summary>
        public static str generateLink(JournalId _journalNum, DataAreaId _company)
        {
            UrlHelper.UrlGenerator generator = new UrlHelper.UrlGenerator();
    
            generator.HostUrl             = new System.Uri(UrlUtility::getUrl())
                                                .GetLeftPart(System.UriPartial::Authority);
            generator.Company             = _company;           // Switches legal entity context
            generator.MenuItemName        = menuItemDisplayStr(LedgerJournalTransVendPaym);
            generator.MenuItemType        = MenuItemType::Display;
            generator.Partition           = getCurrentPartition();
            generator.EncryptRequestQuery = true;
    
            // Filter to the exact journal
            generator.RequestQueryParameterCollection.UpdateOrAddEntry(
                formDataSourceStr(LedgerJournalTransVendPaym, LedgerJournalTable),
                fieldStr(LedgerJournalTable, JournalNum),
                _journalNum);
    
            return generator.GenerateFullUrl().AbsoluteUri;
        }
    }

    In your global payment journal form, add a button or hyperlink control and call the generator per row:

    [FormControlEventHandler(formControlStr(YourGlobalPaymForm, OpenInEntityBtn), FormControlEventType::Clicked)]
    public static void OpenInEntityBtn_OnClicked(FormControl sender, FormControlEventArgs e)
    {
        // Get the current record from your cross-entity datasource
        YourGlobalPaymTable record = sender.formRun()
            .dataSource(formDataSourceStr(YourGlobalPaymForm, YourGlobalPaymTable))
            .cursor();
    
        // Generate a link using THAT record's own legal entity
        str url = VendPaymJournalDeepLink::generateLink(
            record.JournalNum,
            record.DataAreaId);    // Each row carries its own legal entity
    
        // Open in a new browser tab without leaving the current form
        new Browser().navigate(url, false, false);
    }
    The critical line is record.DataAreaId — each row in your cross-entity view carries its own company, and that value is passed directly into generator.Company. This is what makes it work across all legal entities without any hardcoding.
    How D365FO Handles the Entity Switch

    When the deep link is opened:

    https://yourenv.operations.dynamics.com/? cmp=GBSI ← switches to that legal entity &mi=LedgerJournalTransVendPaym ← opens the VendPaym form &q=<encrypted filter> ← filters to that specific JournalNum
     

    D365FO reads cmp= first, switches the session company, then opens the form filtered to the journal. The user sees the correct journal in the correct entity — regardless of which entity they were in before clicking.
    create a new Display Menu Item:
    Object Type                 : Form
    Object                         : LedgerJournalTransVendPaym
    EnumTypeParameter   : JournalTypes
    EnumParameter           : VendPayment

    AllowRootNavigation  :  Yes

    If the issue still persists after following them, please raise a query, and we will be happy to support you further.

    Thanks,
    If you found it helpful, please consider marking it as verified — it may be useful for others in the future!

  • Suggested answer
    Alireza Eshaghzadeh Profile Picture
    15,200 Super User 2026 Season 1 on at
    Hi
    Yes, this can be done with a deep link, but one important point is that deep links in D365FO are not directly based on the form name.
    `LedgerJournalTransVendPaym` is the Vendor payment form. So you need to use the display menu item that opens this form, or create a display menu item for this form if needed. Also make sure the menu item supports root navigation.
     

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 681 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

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

#3
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 579

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans