Page Security Plugin

Javascript page security plugins let developers control field-level visibility or data entry mode in Salesforce CPQ VisualForce pages.
Available in: All Salesforce CPQ Editions

Let’s review a few common page security plugin use cases.

  • You want to show or hide an important field on each quote line. For example, you’re selling training classes and you want to capture how many students are participating in the class. Set up your page security plugin so that the student number field shows only on quote lines related to your training class plugins.
  • You want to make a field read-only or read-write based on its context. For example, you allow your users to specify the subscription term on each quote line, but you have some products that can only be quoted on a 12-month basis. A page security plugin can make the Subscription Term field read-only for such products, while keeping it read-write for the other products.

Example

1//PAGE SECURITY PLUG-IN START
2export function isFieldVisible(fieldName, line) {
3
4	if (fieldName == 'Security_Test__c') {
5		if (line.Security_Level__c != 'Hidden') {
6			return true;
7		} else {
8			return false;
9		}
10	}
11
12	return null;
13
14};
15 
16export function isFieldEditable(fieldName, line) {
17
18	if (fieldName == 'Security_Test__c') {
19		if (line.Security_Level__c == 'Read Only') {
20			return false;
21		}
22	}
23
24	return null;
25
26};
27//END PAGE SECURITY PLUGIN