Set Value of a field with data type "price"

thisisauniqueus
Giga Expert

Hi

i have a field with data type price

find_real_file.png

how can i set the value and currency code of this field. i have tried

current.test = "GBP;100";

but it seems to work for the currecy data type but for price data type its not working pl help

Regards

1 ACCEPTED SOLUTION

Is it possible to change form using a price field to a currency field?


View solution in original post

9 REPLIES 9

Let me know if that solves your problem.


ramireddy
Mega Guru

First check whether GBP currency is active in "fx_currency" table or not. If GBP currency is active, check what is the currency code. Most probably it will be symbol. try like below, which is worked for me.



current.test = " £;1000";


Thanks for taking your time and answering the question. It works for the currency data types but for price data type it does not work..



I copy pasted (in the calculated field of data type price)



answer = " £;1000";



and the result was


find_real_file.png



does it has something to do with the instance's default data currency type??



Regards


Hi John,



Most likely. Double check your setting in: System Properties > System Localization. By default it's set to USD.


Try to set it like that:


find_real_file.png


Another factor is user settings.



I found these topics useful, hope it will help you.



Using the Single Currency Model in your Instance


Converting amount & currency type based on locale




Cheers



Greg


Hi Greg,



Thanks alot for taking your time and providing some value able insight into the currency model of servicenow.



Best Regards


JS