You are here: Parts > Managing Serial Number Filters

Adding and Managing Serial Number Filters

OVERVIEW

Any field, including custom Serial Number fields, can be used as filter attributes. Serial Number filters allow you to control access rights to the parts. In order to create a Serial Number filter, you will need to identify parts with certain custom values and then create permissions to view each classification.

Filtering happens when a user enters CPQ Cloud and a filter has been created to show that person a specific set of parts.

Filtering serial numbers only affects the parts seen by an end user, not an admin using Administration pages.

Example: Create a custom Serial Number field called Brand. You want to filter parts so that users in the United States can only see parts that are Brand1 while users in Europe can only see parts that are Brand2. All users can see parts without a brand. Create filter rules based on this new custom field.

The filter can be based on username, company name, user type, company type, user groups, and Customer ID.

ADMINISTRATION

ClosedCreating a Serial Number Filter

  1. ClosedNavigate to the Parts Search for Admin page.

    1. Click Admin to go to the Admin Home Page.
    2. Click Parts under Products.

      The Parts Search for Admin page appears.

  2. Click Customize Serial Number Fields.

    The Serial Number Defined Fields page appears.

  3. Create a custom field, if necessary.

    For more information, see Custom Serial Number Fields.

  4. In the Serial Number Defined Fields section, choose an existing custom field or your newly-created custom field and set the value in the Filter/Normal column to Filter.
  5. Click Update.
  6. In the Advanced Scripts column, click Define Script next to the custom part field you chose.

    The BML Editor page appears.

    You may need to click off of your custom field's row before the Define Script button appears.

  7. Write a BML script to define the filter.

    The return for a serial number filter is a list of allowed values, separated by commas.

    For more information, see What is BML.

    The following attributes are available as inputs to the filter: 

    Attribute Name Variable Name Data Type Description
    User Login Name _username String

    Restrict or allow access to a serial number by selecting a specific user login to add to your filter script.

    For example, if (_username = "joesmith") { return ""};

    Company Login Name _company String

    Restrict or allow access to a serial number by selecting a company name to add to your filter script.

    For example, if (_username = "joesmith" and _company = "CPQ Cloud") { return ""};

    User Type _user_type String

    Restrict or allow access to a serial number by selecting a user type to add to your filter script: RestrictedAccess, FullAccess, QuickRegistrationBuy, ChannelAgent, SalesAgent and/or BuyAccess.

    For example, if (_username = "joesmith" and _company = "CPQ Cloud" and _user_type = "ChannelAgent") { return "" };

    Company Type _company_type String

    Restrict or allow access to a serial number by selecting a company type to add to your script: RestrictedAccess, FullAccessWithESales, BuyAccess, and/or QuickRegistrationBuy.

    For example, if (_username = "joesmith" and _company_type = "FullAccessWithESales") { return ""};

    User Groups _user_groups String

    Restrict or allow access to a serial number by selecting a user group to add to your filter script.

    For example, if (_user_groups = "Girl Scouts) { return Acme Parts; } return "";

    Customer ID _customer_id String Restring or allow access to a serial number by selecting a Customer ID.
  8. Click Check and Save.
  9. Click Deploy to activate the custom fields and filters.

Example:

The following example script shows how parts filtering can work: 

//Logic: Filter parts based on company's user type

//Field returned: String

if (_company_type=="BuyAccess" and _user_type=="FullAccess"){return ""};

return "Acme Parts, Generic Parts";

    This script example could be used to filter a serial number based on company type and user type. FullAccess users in the BuyAccess company type see all classifications of serial numbers because all menu values are returned with the double quotes. Any other user type sees serial numbers classified as "Acme Parts" or "Generic Parts".

ClosedRemoving Filters

You can remove a filter from a defined field in one of two ways.

  1. Choose the field whose filter you want to remove, and do either of the following:
  2. Click Deploy to activate filter changes.

USE CASES

ClosedInactivating Parts

You need to mark some Serial Numbers as inactive and remove them from use, but without removing them from the parts database.

  1. Add a new single-select menu field using the steps in the section Creating a Serial Number Filter.
  2. Create a required field with the options: Active and Inactive.

    Set the appropriate default value for your case.

  3. Write return "active" in the filter script. The new field will be blank for all existing Serial Numbers. You must set it to the desired value for all existing Serial Numbers.

NOTES

RELATED TOPICS

Related Topics Link IconSee Also