Left Menu Right Menu
April 10, 2018

Add Custom Action

Created by: Paul Ojennus, Whitworth University

Note: With special thanks to Nick Budak who originally developed the code.

Code repository:

Description: Add custom action such as report a problem, send text message, or view PNX to the “Send to” ribbon in Primo.


System Components: PBO, Package Manager

Skillset Requirements: PBO, Javascript

Implementation Steps:
  1. In the PBO make sure you have the “Inherit Central Package” box checked.
  2. In your local package, in the custom.js file, include the module ‘customActions’ in your app definition, for example:

    var app = angular.module('viewCustom', ['customActions']);

    (if you are using other angular modules your app definition will include those also.)
  3. In your local package, in the custom.js file, include the following block of code from this file.
  4. You can customize the fields:
    name: this is internal to the code, it just needs to be unique
    label: this is the text that will appear in the Send To ribbon
    index: any integer, 0 is on the far left
    icon: the name of the icon from https://material.io/icons/
    icon-set: the name of the icon set
    link: the URL you are opening; you can insert data from the pnx as in {pnx.search.recordid[0]}

  5. You can add multiple custom actions: repeat the <custom action> element in the template and assign a unique name to each action.
  6. Zip and upload your local package in the PBO
  7. Deploy your view
Related Customizations
Back to Blog
Comments (0)
Reply To Article