Symptom
- When running a specific script in the Script Workbench, the Default Market selected on the User Page for the logged-in user is not displayed as the default Market in the traces.
- The script is: r = [m for m in User.GetAvailableMarkets if m.IsDefaultMarket]
- The issue is that the user's current active market cannot be identified when outside of a quote.
Environment
SAP Sales Cloud CPQ
Reproducing the Issue
- Go to the User Menu
- User Page
- Note the default market selected on the User Page
- Open the script workbench
- Paste and run this code: r = [m for m in User.GetAvailableMarkets if m.IsDefaultMarket]
Cause
The IsDefaultMarket property of a market indicates whether it is set as the system default in the Setup section — it does not reflect the market selected by the user on their User Page.
Resolution
- Currently, the market for the user is not accessible through scripting.
- The User.GetAvailableMarkets in scripting returns all markets visible for the user, based on market visibility which was added for the company of the user on the market visibility page in setup.
- The IsDefaultMarket property is a property of the market itself and indicates if the market is the default in the system. It does not reflect the market chosen by the user in the User Page.
See Also
Keywords
SAP CPQ, Scripting, Default Market, User Page, Market Visibility, IsDefaultMarket Property , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , Bug Filed
Product
SAP CPQ all versions