Hello colleagues,
I'm working with Power Automate flow and need to get the URL link to the sales order created?
What is the best way to do this?
I have started working with https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/user-interface/create-deep-links and I created the following code:
using Microsoft.Dynamics.AX.Framework.Utilities;
class DeepLinkTest
{
    public static void main(Args _args)
    {
        MenuItemNameDisplay menuItemName                = menuItemDisplayStr(SalesTable);  // customer form
        MenuItemType        menuItemtype                = MenuItemType::Display;
        str                 filterformDataSource        = formDataSourceStr(SalesTable, SalesTable);  // filer datasource
        str                 filterFormDataSourceField   = fieldStr(SalesTable, SalesId); // filter field
        UrlHelper.UrlGenerator generator = new UrlHelper.UrlGenerator();
        System.Uri currentHost = new System.Uri(UrlUtility::getUrl());
 
        generator.HostUrl = currentHost.GetLeftPart(System.UriPartial::Authority);
        generator.Company = curExt();
        generator.MenuItemName = menuItemName;
        generator.MenuItemType = menuItemtype;
        generator.Partition = getCurrentPartition();
        generator.EncryptRequestQuery = true;
        if(filterformDataSource)
        {
            UrlHelper.RequestQueryParameterCollection requestQueryParameterCollection;
 
            requestQueryParameterCollection = generator.RequestQueryParameterCollection;
            requestQueryParameterCollection.UpdateOrAddEntry(filterformDataSource, filterFormDataSourceField, "SalesId"); // applying filter
        }
        System.Uri fullURI = generator.GenerateFullUrl();
 
        Info(fullURI.AbsoluteUri); // getting deep link
    }
}
I need this URL in PowerAutomate flow, so can I put this link into a table so I can use it later?
Thanks.