read value of recurring price cat_item

xlarge74
Tera Expert

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

1 ACCEPTED SOLUTION

@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.

View solution in original post

14 REPLIES 14

are there maybe any other thoughts?

@xlarge74 

 

Can you please share a screenshot of your entire client script record? I am beginning to believe it is an issue with this. Could it be an issue with your Application scope being different

 

I was able to accomplish what you are trying. Also I'd like to quickly note that currency fields return with the currency type prior to the number, as you will see in the screenshot below, which may require you to do some additional scripting if you're trying to extract just the number.

 

jc21_0-1742226611668.png

 

Here is the client script I am using:

jc21_1-1742226644599.png

 

ok i´m puzzled 😞

 

 

@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.

as we were a little bit under pressure, we are using now a variable which holds the price, because we needed it for manipulation. thanks for your help jc21 and your precious time 😄