Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How do I get the sales order link?

(0) ShareShare
ReportReport
Posted on by 781

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.

  • AnithaEswaran Profile Picture
    2,032 on at
    RE: How do I get the sales order link?

    This might be bit complicated. You need to encrypt while calling the URL

    devblog.sertanyaman.com/.../

    You can try other options of creating the sales order using standard entity and that would give the details of new sales order as it response.

  • Shooowtek Profile Picture
    781 on at
    RE: How do I get the sales order link?

    I want to get the URL for the details of a sales order.

    I am creating a sales order using a Power Automate workflow, and then I want to send a confirmation email to the user with the URL of the created order.

  • AnithaEswaran Profile Picture
    2,032 on at
    RE: How do I get the sales order link?

    Hi,

    can you explain what are you trying to do here ?

    Are you trying to get the details of 'Sales order' which you create from PA?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,095 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans