+ Start a Discussion
VRKVRK 

Help required on Trigger code

Hi Team,
pls find below my requirement :
i have Case object and custom object . Both have same Record Types.
In custom object contains ' Manager reviwer ' value.
When case status is ' pending for manager review ' then its send notificaiotn to custom object ' Manager reviwer ' ... based on Record Types..
can you anyone provide code for this requirement ...


 
Leon ThanikalLeon Thanikal
Hello sekhar,

If you really need to use a trigger then you will have to explain a bit more clearly about the process and the fields that you want. 

If you want to send a notification to the manager of the case object whenever the case status is changed to 'pending for manager review' then the best way to do that is use process builder and use that to send a notification to the manager to review the case. This is better since it uses an out of the box solution and there is no reason to code.
VRKVRK
Thanks Leon for your quick response.
Pls find below  more details on this :

example :

When case status is Waiting for Manager  for Task record Type ' Employee' ....  in this Case , if no Manager value defined in the Case detail page , then lookup 'Manager'  value from Custom object (SLA) for same Record Type ' Employee...' , then send notificaiton ..

i tried Process builder , this scenario not working ...because there is no relation between Case and SLA custom object ..
i hope now you got clear requirment ...pls let me know if you need any more detail on this
 
Deepali KulshresthaDeepali Kulshrestha
Hi Sekhar,

1.why don't you use chatter? Not sure if all this custom stuff is needed:

 -check this out:
  https://trailhead.salesforce.com/en/content/learn/modules/chatter

2.And you can follow these steps to configure Push Notifications for Salesforce:
  
 -Choose when push notifications appear and which objects and fields trigger them:

   1.From Setup, enter Apps in the Quick Find box, then select Apps.
   2.Select a console app, and click Edit.
   3.In Choose How Lists Refresh, select when push notifications appear.
    Note:
     NOTE If you don’t see this option, enable Streaming API in your org.

               OPTION             DESCRIPTION
               None             Lists don’t refresh and push notifications don’t appear.
               Refresh List     The entire list refreshes when there are any changes to it. Records are added or removed from the list based on the list’s criteria, but new records added to queues only refresh the record owner’s list.
               Refresh List Rows     Rows in the list refresh when there are any changes to fields selected for push notifications.

   4.In Choose How Detail Pages Refresh, select when push notifications appear.

                 OPTION                    DESCRIPTION
                 Do Not Refresh            Detail pages don’t refresh and push notifications don’t appear.
                 Automatically Refresh    The detail page automatically refreshes when a record is changed.
                 Flag                     A message appears on the detail page when a record is changed.

   5.Click Select objects and fields for notifications, and select Edit. The push notification settings you choose here apply to all your console apps.
   6.Select the objects that you want to trigger push notifications. For example, if you want any changes to cases or case fields to trigger push notifications, move Cases from Available Items to Selected Items.
   7.Under Fields, click Edit and choose the fields you want to trigger push notifications.
   8.Click OK, then select Save.
   9.Grant push notification users at least the “Read” permission on the Push Topics standard object. See User Permissions and Access.



I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com