Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

​ Change color of a field in a form when a customization for changing the color already exists

(0) ShareShare
ReportReport
Posted on by 18
Hi all,
I am trying to change the color of a field in form using displayOption method. My issue is there is already a customization using displayOption method to change color of few other fields in the same form, which is resulting in color change for all the fields. Eg. In the salesTable form existing customization is to show UnitPrice and 2 other custom fields (from salesline table) in green when when the price is coming from trade agreements. My customization is to show SalesQty( from salesline) red when SalesQty value is greater than available qty for reservation. Now the issue is all 4 fields are turning red when my code is triggered.
This is because the formControl from all the fields are “added” to the “_options”(FormRowDisplayOption) variable and then using this the color is set.
I tried using “_options.clear()” statement before my logic, this results in the previous customization to not work ( when debugging the color is being changed to green but not refelecting in the front end).
I wanted to know how to resolve this issue.
  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    ​ Change color of a field in a form when a customization for changing the color already exists
    Hi Anand,
     
    If you want to change the color of the only one field in the form - Try the below link and see if it helps.
     
    Thanks,
    Girish S.

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.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,162 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans