web
You’re offline. This is a read only version of the page.
close
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 483

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 .

I have the same question (0)
  • Suggested answer
    Mohamed GRAIB Profile Picture
    2,504 Moderator on at

    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

  • Suggested answer
    Leco Lv Profile Picture
    on at

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 60 Most Valuable Professional

#2
#ManoVerse Profile Picture

#ManoVerse 51

#3
Satyam Prakash Profile Picture

Satyam Prakash 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans