npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

prince-xrm

v1.0.2

Published

Prints your Dynamics 365 forms.

Downloads

2

Readme

Prints Dynamics 365 forms as pdf's.

Converts forms to .pdf report using jsPDF, including form's:

  • visible attributes that contain data
  • subgrids (rendered as nested forms)
  • embedded web resources that display text

Installing

For the latest stable version, copy from /dist/prince.min.js or npm i prince-xrm.

Usage

  1. Import Prince
import Prince from "prince-xrm"
  1. Create a config object extending IPrinceConfig
export default interface IPrinceConfig {
    entityName: string;
    entityId: string;
    forms?: Array<{
        formId: string;
        entityName: string;
    }>;
    webResources?: Array<{
        name: string;
        attribute: string;
    }>;
}

Print form

Prince.printForm(config: IPrinceConfig | string)

Store form state so it can be printed later

Prince.storeForm(primaryControl: Xrm.FormContext | Xrm.Page.EventContext attribute: string, config?: IPrinceConfig | string, form?: Form)
  • primaryControl execution context from form or ribbon event.
  • config configuration needed to get @param form.
  • attribute schema name of attribute to store the form in.
  • form form to store. If not given, it is retrieved.

Print a stored form

Prince.printStoredForm(primaryControl: Xrm.FormContext | Xrm.Page.EventContext, attribute: string)
  • primaryControl execution context from form or ribbon event.
  • attribute schema name of the attribute where the form string is stored.

Examples

Creating a config

const config = {
    entityId: "BB42C9F1-AE20-E911-A974-0022480186C3",
    entityName: "new_parent",
    forms: [
        {
            entityName: "new_parent",
            formId: "592e38a0-d028-493f-b916-d89a87a6d1b2",
        },
        {
            entityName: "new_child",
            formId: "37A83C9B-76D1-46A0-976C-9AA6168AA279",
        },
    ],
    webResources: [
        {
            attribute: "new_simpletext",
            name: "WebResource_SimpleText",
        },
    ],
};

Storing a form and printing it

import Prince from "prince-xrm";
Prince.storeForm(executionContext, "new_formstorage");
Prince.printStoredForm(executionContext, "new_formstorage");

There's no need to store a form and immediately print it, as this can be done in one line using Prince.printForm. However you may want to store and print a form in separate functions, so that the state of a form can be stored at one moment in time and printed at a later date.

Printing a form

import Prince from "prince-xrm";
Prince.printForm(config);

After

Backlog

  • Support subgrids shown with view columns
  • Support multiple columns layout on forms
  • Increase customisability through input config IPrinceConfig

Contributing

  1. Clone the prince repository
  2. cd prince`
  3. npm install
  4. Build with npm run build
  5. Lint with npm run lint
  6. Test with jest using npm run test