The code defines a field for "Planned Time" with a style controlled dynamically by the StyleExprTxt variable. The OnAfterGetRecord trigger updates StyleExprTxt by calling the GetStyleBasedOnTime procedure from the TimeStyle codeunit. This procedure sets the field's style based on the current time and the planned time value:
It returns 'favorable' if the current time is within 10 minutes before the planned time.
It returns 'Unfavorable' if the current time is past the planned time.
It returns an empty string as a default if neither condition is met.
Don't forget to like and close it by verifying if answer is satisfied.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156