Announcements
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.
generator.Company
LedgerJournalTransVendPaym
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.
[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); }
record.DataAreaId
When the deep link is opened:
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!
cmp=
Object Type : Form Object : LedgerJournalTransVendPaym EnumTypeParameter : JournalTypes EnumParameter : VendPayment
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.
Jump in, show your community spirit, and win prizes!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Abhilash Warrier 681 Super User 2026 Season 1
André Arnaud de Cal... 598 Super User 2026 Season 1
Giorgio Bonacorsi 579