{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":38003,"path":"order-management/system_fields_vs_partner_fields.md","title":"CPQ fields, system fields, and partner fields","bundle":null,"doc_type":null,"release":"australia","body":"\n# CPQ fields, system fields, and partner fields\n\nLearn about the three types of fields in CPQ—CPQ, system fields, and partner fields. Understand how each type stores, retrieves, and displays data in configurations, and how they interact with Salesforce and partner systems for seamless data integration.\n\nThere are three categories of fields in the CPQ environment: CPQ fields, system fields, and partner fields.\n\n## CPQ fields\n\nA CPQ field is a user-defined field that is custom to the CPQ environment. Its type can be number, text, picklist, set, or product picker. When users create fields in CPQ, they can manually assign default values in the field definition, or they can set values through determination actions.\n\nThe following example shows how a user would set a CPQ field in an On Configure/Reconfigure enrichment:\n\n```\ncfgRequest.testField.set(\"value\", \"Hello World\"); \n```\n\nFor a more complete description of CPQ fields, see [Configure fields](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/order-management/fields_101.md).\n\n**Note:** In organizations that do not use Salesforce for their launch-point into CPQ, all fields must be initialized in their API call.\n\n## System fields\n\n\\[Omitted image \"cpq-fields-system-fields.png\"\\] Alt text: System fields\n\nSystem fields are predefined. System fields cannot be assigned a default value because they leverage the SFDC product cache \\(or the current date and time\\) to generate their values.\n\nThe following example shows how a user would call a system field in an On Configure/Reconfigure enrichment:\n\n```\nlet pC = {\"input2\":cfgRequest.sys.productCode.value};\n```\n\nSystem fields can be added directly to any layout. There are no issues with displaying them regardless of whether they contain predefined data.\n\nIn the layout editor:\n\n\\[Omitted image \"cpq-fields-layout-editor.png\"\\] Alt text: Layout editor\n\nIn the Configurator UI:\n\n\\[Omitted image \"cpq-fields-configurator-ui.png\"\\] Alt text: Layout editor screen\n\nUnit of Measure is blank because in this example, it has not been defined in SFDC.\n\nThe mapping of each of these system fields to their respective SFDC object is as follows. The field API name is in parentheses.\n\n-   sys.productUOM &gt; Product: Quantity Unit Of Measure \\(QuantityUnitOfMeasure\\)\n-   sys.productName &gt; Product: Product Name \\(Name\\)\n-   sys.productFamily &gt; Product: Product Family \\(Family\\)\n-   sys.productDescription &gt; Product: Product Description \\(Description\\)\n-   sys.productCode &gt; Product: Product Code \\(ProductCode\\)\n-   sys.enableValidation: value defaults to true\n-   sys.currentDate: Simple time API call, returns date of UTC\n-   sys.actionContext &gt; Quote Line: Action Context \\(LGK ActionContext c\\)\n-   sys.productPrice &gt; Price Book Entry: List Price \\(UnitPrice\\)\n-   sys.productId: value depends on Admin Settings\n\n    sys.productId changes to whatever is defined in your CPQ environment settings. For instance, if the Product Id field was set to Product Code, the resulting data would be Product Code, making it identical to the sys.productCode field.\n\n\n\\[Omitted image \"cpq-fields-product-code.png\"\\] Alt text: Product code\n\nIf the Product Id field was instead set to Partner Id, the data would be pulled from the SFDC field Product2 Id \\(ID as the field API name\\):\n\n\\[Omitted image \"cpq-fields-partner-id-example.png\"\\] Alt text: System fields screen\n\n## Partner fields\n\n\\[Omitted image \"cpq-fields-partner-fields.png\"\\] Alt text: Partner fields\n\nPartner fields are fields that use a POST call to initialize a configuration via API. Partner fields leverage the partnerʼs data set to generate field values.\n\nThe mapping of each of these partner fields to their respective SFDC object is as follows. The field API name is in parentheses.\n\n-   partner.quote.id Quote &gt; Record ID \\(Id\\)\n-   partner.quote.lineId Quote Line &gt; Record ID \\(Id\\)\n-   partner.quote.pricebookId Quote &gt; Pricebook ID \\(SBQQPricebookIdc\\)\n-   partner.quote.currencyIsoCode Quote &gt; CurrencyIsoCode\n\n    partner.quote.currencyIsoCode defaults to USD if your organization does not have multi-currency enabled in their Salesforce Org. To enable multi-currency, follow the steps in this Salesforce article: [Enable Multiple Currencies](https://help.salesforce.com/s/articleView?id=sales.admin_enable_multicurrency.htm&type=5).\n\n\nWhen using these fields, it’s important to note that some of the data may not have any value \\(null\\) when the product is first configured. To make sure that there are no initialization errors, include null checks in any rules or scripts that utilize partner fields.\n\nThese fields cannot be directly added to a layout like system fields can. Instead, you can use CPQ fields to populate the data in partner fields via an initialization enrichment.\n\nThe following example initialization enrichment populates the values of the partner fields into the configurator:\n\n```\nlet quoteId = cfgRequest.partner.quote.id.value;\nlet lineID = cfgRequest.partner.quote.lineId.value;\nlet currencyISO = cfgRequest.partner.quote.currencyIsoCode.value;\nlet priceBookID = cfgRequest.partner.quote.pricebookId.value;\n\nif (quoteId != null) {\n\tcfgRequest.quoteIDTest.set(\"value\", quoteId);\n}\nif (lineID != null) {\n\tcfgRequest.lineIDTest.set(\"value\", lineID);\n}\nif (currencyISO != null) {\n\tcfgRequest.currencyISOCodeTest.set(\"value\", currencyISO);\n}\nif (priceBookID != null) {\n\tcfgRequest.pricebookIDTest.set(\"value\", priceBookID);\n}\nreturn cfgRequest;\n```\n\nInitial configuration:\n\n\\[Omitted image \"cpq-fields-initial-config.png\"\\] Alt text: Initial configuration screen.\n\nReconfiguration:\n\n\\[Omitted image \"cpq-fields-reconfig.png\"\\] Alt text: Partner fields\n\nLine ID is now populated.\n\nHow you use partner and system fields is up to you. Some organizations find it helpful to display this information in the configurator to the end user, while others use it in the background in rules to drive pricing conditions.\n\n**Related topics**  \n\n\n[Grid-style fields and field collections](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/order-management/what_field_type_should_i_use_for_organizing_field_options_and_data.md)\n\n[Configure fields](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/order-management/fields_101.md)\n\n"}}