• Nellson Swasono
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
I have a Apex Trigger on creation of a record that calls an Apex class. The point of a method in the class is to check the current time of user and see if it is within business hours.

However, I want to display a toast (Either a warning or danger) if the user tries to input time outside of business hours. Is this possible?

Apex Code:
~~~
if (userTime > endTime && userTime < startTime)
    System.debug('YOU ARE OUT OF HOURS');
    //This is where I would like to call a toast
~~~

I have created toasts within lightning components and javascript controllers, but is it possible to do call the toast here? If so, how?
I want to have a toast appear when updating a record of a certain type, is this possible?

Basically in the grand scheme of things I would have to call my javascript controller (for the toast), in an .apxc file (Connected to a trigger). Is this possible to do? If not, what are some possible work arounds?
I want to have a toast appear when updating a record of a certain type, is this possible?

Basically in the grand scheme of things I would have to call my javascript controller (for the toast), in an .apxc file (Connected to a trigger). Is this possible to do? If not, what are some possible work arounds?