Hide edit (penicl) icon on currency field

staceyrocheleau
Kilo Guru

I want to hide the "edit"/pencil icon on a currency field in procurement. I find that when users edit the price using the edit button instead of just changing the value in the field, the price isn't triggering the client scripts or business rules to update the total price. I want to remove this button as users do not need to be redirected to another window in order to change the price. I want them entering the value within the field itself. I found this article a while ago which works well in Fuji:

How to hide the 'edit' link on currency field on a form

But this does not work in Geneva UI16. When I tried it, the button would hide temporarily and then reappear (see my post below.) Anyone know how to remove this button? I'd love it if the answer was to set an attribute on the field but I'm doubtful it's that easy. I do not want to set the property to make everyone use the same currency as we do require 2 currencies.

In Genevea the edit button shows as a pencil button and it doesn't work the same as in Fuji. If change the display style settings for editLink and currency (same code, just swapping the 2 names), the currency drop down is hidden but the edit button is not.

edit button.PNG

I've tried inspecting the item in my browser. The id is still proc_po_item.cost.editLink but after my onLoad hides it, it pops back up on the form.

If I add an alert("test"); after the display command, I can see that it disappears until I click "ok" when it reappears:

removed edit.PNG

7 REPLIES 7

Stacey,



    Open your browser developer tools and see if there any errors in the console while loading the form.


Hi Stacey,



I know this is an old post but I came across it when my code wasn't working to hide the icon (and I've used it to hide other icons).   What I realized was I had an existing UI policy that was calling the field and they were conflicting.   I disabled the new script and put the code and in the execute if true script in the existing ui policy and it works great.   I hope this was helpful.


Wade Clairmont
Tera Guru

One thing that I found and had to share, was if you are going to use this, you must include the table name to specify the field in your script.



example:      


function onLoad() {


  $('ast_contract.payment_amount.editLink').hide();


}