Announcements
I want to add the either sign % or $. I have used the data type of columns as decimal number but how to embed the percentage sign against every value same like this:
Please Reply🙏
Thanks 🙂
Hello @Tiksha,
Hope you are doing good, As per OOB Behavior if you are using CURRENCY field it will automatically show $ or any other Currency based on which you are showing. For Showing % there is no OOB Behavior available.
But you can write JS to change the LABEL of the TEXT BOX dynamically
function changePercentageValues(executionContext){ var formContext = executionContext.getFormContext(); if(CHECK FIELD IS PERCENTAGE = %){ formContext.getControl("FIELDLOGICALNAME").setLabel("% FIELD LABEL"); } else{ formContext.getControl("FIELDLOGICALNAME").setLabel("CURRENCY FIELD LABEL"); } }
But the Only Problem here is we can't get the same Names in VIEWS/Sub-Grid or Advanced Find.
Please mark as Answer if it is helpful and provide Kudos
Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLABlog : https://microsoftcrmtechie.blogspot.com
Thanks for the solution @rampprakash
function onChangeAdjustmentFactor(executionContext) { var formContext = executionContext.getFormContext(); formContext.getAttribute("crcd7_adjustmentfactorforworkhours").setValue("%") if (formContext.getAttribute("crcd7_adjustmentfactorforworkhours").getValue() != null) { formContext.getAttribute("crcd7_adjustmentfactorforworkhours").setValue(formContext.getAttribute("crcd7_adjustmentfactorforworkhours").getValue() + "%") } else { formContext.getAttribute("crcd7_adjustmentfactorforworkhours").setValue(null); } }
This solution provided by you, also worked for me.
Also I have configured another way as well that we can use, which is using pcf component. Using this, we also not need to change datatype of column. But this worked on Forms not on Views
https://pcf.gallery/prefix-suffix-control/
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 316 Most Valuable Professional
11manish 242
Valantis 198