Lookup Queries Do Not Work Properly When Field Values Contain Commas
Trailblazer Community

Lookup Queries Do Not Work Properly When Field Values Contain Commas

Salesforce CPQ (Configure-Price-Quote)

Last updated 2019-11-01 ·Reference W-5580872 ·Reported By 1 users

No Fix

When using a lookup query price rule in the line editor, if the lookup query field value contains commas, changing it to another value also containing commas will query the wrong record, based on the previously set value and not the new value, and insert the wrong Source Lookup Field value.

1. Create a custom object (or use the Lookup Data object for the following steps)

2. Create a custom currency field (Price)

3. Create a custom text field (Product Code)

4. Create a custom picklist field; put a comma in some of the values, and not in others

5. Create a picklist on quote line with the same values. (Also create it on Product Option if you want to reproduce the customer's use case more closely, but it is not necessary to reproduce the actual issue, since it can also be reproduced directly from the QLE. If you create the twin field on Product Option, make sure both API names start with SBCustom so they will map correctly in internal dev/test orgs)

6. Create a product, give it a product code. (If you want to reproduce the customer's use case, add a configuration attribute targeting the product option custom picklist, and set Configuration Type to Required or Allowed, and Configuration Event to Always.)

7. Create records on the lookup data object, all with the Product Code field set to the value of your product, each one with the picklist set to a different value, and each with a different amount in Price

8. Create a Price Rule, Scope = Calculator. Set Lookup Object to the API name of your custom object (you will have to add it to the picklist)

9. Create a price condition that the quote line picklist is not Value = (null) [This is probably not necessary, it was just on the customer's setup]

10. Create a Lookup Query: Match Type = Field Value, Tested Object = Quote Line, Tested Field = the custom picklist on QL, Operator = equals, Lookup Field = the picklist on the lookup object

11. Create another Lookup Query: Match Type = Field Value, Tested Object = Quote Line, Tested Field = Product Code field on QL, Operator = equals, Lookup Field = the Product Code text field on the lookup object

12. Create a Price Action, Target Object = Quote Line, Target Field = List Price (or SBQQ__ListPrice__c, or ListPrice__c if your environment doesn't have a prefix for standard CPQ fields), Source Lookup Field = the Price field on the lookup object

13. Go to Quote Line object in setup, and add the picklist to the Line Editor field set

14. Create a quote, Edit Lines, Add Products, add the product you created. (If you are reproducing the customer's setup, next steps will differ)

15. On QLE, set the picklist value to something with commas, and click Calculate. (If you are in configurator, set the picklist config attribute, then click Save.) Verify that after calculate (or config save), the correct source lookup Price field value from the record matching the picklist value is inserted into List Price.

16. Change the picklist to a different value that does not contain commas (or reconfigure and change the picklist), then click Calculate again (or re-save configurator). Observe that List Price is changed to match the lookup object record with the new picklist value.

17. Change the picklist to another value (not the value you first set) that also has commas in it, then click Calculate. (Or reconfigure, change the picklist, and re-save config if reproducing the customer use case.) Verify the new List Price value.

Remove commas from field values used in the lookup query.

Reported By (1)

Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.