Next-generation platformDeprecated

Extending the Notes widget

Learn how you can customize and extend your Notes widget implementation to add or remove note filters.

About this task

By default, the Notes widget has three filters, namely, System, User, and Important. Using these filters, you can filter the list of notes based on the user who added it, System or User, and the Important flag.

You can customize the Notes widget to add new filters or remove the existing filters to suit your business needs.

Use the following procedure to add new filters or remove existing filters.

Procedure

  1. Create the following folder structure, if not already present:
    /store-frontend/store-extensions-src/app/shared/components/notes-modal
  2. Copy the file notes-modal-filter.config.ts from /store-frontend/src/app/shared/components/notes-modal to /store-frontend/store-extensions-src/app/shared/components/notes-modal.
  3. Update the NoteFilterCriteria array based on your requirements.
    • For example, if the Important filter is not required, remove the object item having the complexQryExp name as Priority from this array.
    • To add a new filter, add a new object item in same structure as the existing objects.
      The NoteFilterCriteria array can have a filter object with the following properties:
      Table 1. Extending the notes widget
      Property Type Mandatory Usage
      tid String Yes ID used for testing and must be unique for each filter.
      translationKey String Yes Key used by the ngx-translate module to show the label of the filter.
      checked Boolean No Whether the filter is selected by default in the Notes widget. This must always be set to false by default.
      complexQryExp Object Yes Query info used for this filter item by the mashup. This query must have Name, QryType, and Value.
      For example, for the System filter, the complexQryExp query is as follows:
      { 'Name': 'Createuserid',
      'QryType': 'EQ',
      'Value': 'SYSTEM' }