Symptom
Resolution
CPQ
Summary:
This article will brief you on how to get Decimal value of custom field in XSLT
Details:
Scenario: We need to get the decimal value instead of the display value on an XSLT to run an XSLT compare. We have a situation where we need to compare two values in an XSLT: <xsl:if test="FloorPrice != 0 and FloorPrice > NetPrice" >. It happens that NetPrice is an out of the box field and we've set the rounding to 6 digits for it but we cannot do the same for FloorPrice (a custom field). The problem is that we need an, at least, 3 digit decimal point rounding. We are thinking it twice to set the global default rounding to more than 2 digits because it is a global change, we'll affect every number display on the system.
Example: The quantity drives the price if you set it to more than 5000000 it’ll be equal to FloorPrice, in this case, the compare is not showing the FloorPrice of 0.015 but 0.02, and it appears it uses this value on the compare also because 0.02 > 0.015.
Reason: The XSLT is using values provided in XML in order to render the HTML on the page. The XML contains rounded values, so there is no way to access the value in the database (DefaultDecimal).
Solution for this situation:
Comments:
N/A
Reference:
- SC30322857
Keywords
KBA , CEC-SAL-CPQ , Sales Cloud CPQ , How To