Symptom
Custom Field Access Level via scripting is ignored on the Quotation tab in SAP CPQ: even when set to Read Only during “Before quote rendering".
Environment
SAP CPQ
Reproducing the Issue
- Open a new quote in status 'In Progress' (default)
- Open Global Script
- The Global Script must be the last entry in the event 'Before quote rendering' otherwise Access Level are ignored
- Set an Access Level of a Custom Field
- Log the Access Level to the console after that
- The right Access Level is printed to the console, but the Custom field still always use the visibility which is defined on the custom field itself
Cause
Before quote rendering event as a condition for some action, and it overrides the existing custom fields that are saved because they are being loaded and overridden
Resolution
- You can use CTX tag for the custom field value instead of calling it in the script.
- Example: [IF]([EQ](<*CTX( Quote.CustomField(custom_field_name) )*>, custom_field_value)) {execute script} [ENDIF]
Keywords
CTX Tag, custom field, access level, error, script, quote, CPQ , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , How To
Product
SAP CPQ all versions
SAP Knowledge Base Article - Public