- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 08:19 AM
hello
i would like to read the value of the recurring_price field (cat_item) in a client script.
there is a value entered, but i dont get it.
i tried with g_form.getValue('recurring_price') and i read about current..... but the script shows an error when current is used.
kind regards
Oliver
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 08:35 AM
@xlarge74 Ok yeah so it looks like you have this set up as a catalog client script. This is looking for a variable on the catalog item called recurring_price, which doesn't exist.
I will note that you also need to set the value in Recurring price frequency in order to see that value display alongside the price in the widget on the right of the service catalog. To access the value.
What are you trying to do with the recurring price information? If you simply want to display it, just set the frequency and it will display as mentioned above. If you are trying to use the value for manipulation, that will be more complex.
I will note that you can technically access the value at $scope.data.sc_cat_item.recurring_price_subtotal. I found this out by CTRL + right-clicking the price widget, logging $scope.data to console, and combing through the data object.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 08:23 AM
First question is what kind of client script is it? Is it an onChange? If so, try using newValue. If it's not an onChange, then can you confirm the value is present when the form is loaded?
I'd recommend trying to console.log your value (console.log(g_form.getValue('field')) in your client script and see what that outputs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 08:40 AM
its an onLoad and it writes a blank field at the console
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 08:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 08:47 AM
What happens if you use getDisplayValue instead?