Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Print Record in D365 with Custom Button Javascript

(0) ShareShare
ReportReport
Posted on by 477

Hello,

Can any one suggest javascript code to print record in D365 which will be called on custom button.

i have tried with https://waleedbinafzal.medium.com/print-preview-in-dynamics-365-new-unified-interface-d62ce9732b9c but its not working .

  • Suggested answer
    Leco Lv Profile Picture
    on at
    RE: Print Record in D365 with Custom Button Javascript

    Hi partner,

    You can try the code of the previous partner, if it still doesn't work, I think it may be the following situation now.

    The code is calling the /_forms/print/print.aspx page, which uses the old legacy web client infrastructure. This infrastructure will be removed when Microsoft finishes transferring all remaining dependencies from the legacy web client (i.e., advanced settings, etc.). So, the workaround may have stopped working.

    You can consider Word templates or reports according to your own needs or vote on Microsoft's "ideas" to express your opinion.

    https://docs.microsoft.com/en-us/power-platform/admin/using-word-templates-dynamics-365

    https ://docs.microsoft.com/ zh-cn/powerapps/maker/model-driven-apps/add-reporting-to-app

  • Suggested answer
    Mohamed GRAIB Profile Picture
    2,494 Super User 2025 Season 1 on at
    RE: Print Record in D365 with Custom Button Javascript

    Hi Krishna,

    Can you try with this ?

    function PrintPreview() {

    window.open(Xrm.Page.context.getClientUrl() + “/_forms/print/print.aspx?allsubgridspages=false&formid=” +

    Xrm.Page.ui.formSelector.getCurrentItem().getId() + “&id=” + Xrm.Page.data.entity.getId() +

    “&objectType=” + Xrm.Page.context.getQueryStringParameters().etc);

    }

    I hope that's helpful for you

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February 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... 293,274 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,947 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans