Queso Posted February 22, 2023 Report Share Posted February 22, 2023 Hi! I just want to share something related to the Currency field on a details page. As of now, if we try to make a Currency field editable on the details page (Changing its form element from 'Display Only' into 'Text Field'), the dollar sign and trailing zero is automatically removed from its decimal. Here is the behavior of the Currency Field in 'Display Only' form element: And, it displays differently when changed into 'Text Field' form element: Quote Link to comment Share on other sites More sharing options...
Queso Posted February 22, 2023 Author Report Share Posted February 22, 2023 Since changing the form element into 'Text Field' removes the value's dollar sign and zero in its decimal, one solution for this is the following JavaScript code. Kindly try this on the Footer section of your Details Page: <span style="display: none" id="tablevalue">[@field:CurrencyNumber$]</span> <script type="text/javascript"> document.addEventListener('DataPageReady', function (event) { var field = document.querySelector("#EditRecordCurrencyNumber"); var tablevalue = document.querySelector("#tablevalue").innerHTML; field.value = tablevalue; }); </script> Note: Just change all the 'CurrencyNumber' in the code into your Currency field name. Quote Link to comment Share on other sites More sharing options...
Queso Posted February 22, 2023 Author Report Share Posted February 22, 2023 The following is its output: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.