Currency Code not showing in Reference type Field for Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 08:03 PM
Hi Everyone,
We have one order guide through which the users order their suitable laptop/desktop. We are using a reference type variable to display the list of laptops and desktops.
Recently, we have received a requirement in which we have to display the price of these catalog items in the dropdown.
So I have used the below reference qualifier to include the price column to the reference variable.
ref_ac_columns=price,ref_auto_completer=AJAXTableCompleter,ref_ac_columns_search=true
But the problem I am facing is that the currency code is not getting displayed. Only the price numeric value is what I am getting.
Kindly let me know how I can display the currency code beside the price value in this dropdown.
Regards,
Sayantan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 09:35 PM
Are you using a custom table to populate the reference field ? I just tried simulating your requirement on cmdb_ci_server table. I think you need to add currency column as well to the attribute ref_ac_columns like
ref_ac_columns=price,currency
This should display the currency as well. Please refer below screenshots and make the configuration accordingly.
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 07:45 PM
Hi Amit,
I tried this solution but the currency did not populate in the dropdown.
In the Maintain item table, catalog item XML I noticed that the unlike cmdb_ci_server table, the currency value is coming from fx_currency table. So seems directly calling currency in the reference qualifier is not providing the result.
PFB the screenshot of the XML:
Kindly have a look and let me know if there's a way to populate the Currency.
Regards,
Sayantan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 09:11 PM
Which table your field is referencing to ?
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 02:13 AM
Hi Amit,
We are not referencing the price from any table. We are trying the fetch the price amount that is saved on each catalog item using the reference variable that we are using in the order guide.
I checked the XML of one of the catalog items and found that the price is only storing the numeric value and not the currency code. That seems the reason the currency code is not getting populated.
<price>37</price>
Kindly let me know if there is any solution so we can also display the currency code.
Regards,
Sayantan