I'm building a custom Notification section, which provides notification or messages to multiple users on any particular object update, I've created a HTML page like Dashboard where I have added a Alert section or notification section, which shows a particular record updates, like there is a Object (table) lets call it ObjA, whenever a record is created or updated with some specific data into that object, for that update a message record is generated and which showed on user on the Notification section. now As moment user click or expend the notification section. that notification should be grayed out, means it is seen by that particular user, and next time when that user come to that page it should grayed out those notification which are seen/read by user. So its like our Email read/unread functionality.Anyone have any idea how to achieve this functionality.What I have done so far, I have created a new object called Notification and every time whenever there is any create or update on that First object (ObjA), I wrote a event based logic which create a new record in notification object and I'm reading that notification object all the time. On the notification I have created a field called Status which include Read/Unread option. Now I want your help to figure out how to set that field as Read on basis of every individual user.P.S. - There are multiple users who sees this notification functionality, so if a UserA seen the message it doesn't mean that UserB also seen that, so userB still able to see that unread mark on the same message in the notification section.Let me help what's the best way to achieve that.Thanks in advance!
Need Help to build a Custom Notification read logic for Individual user basis
object oriented;algorithms;functional programming
I managed to get the solution for this issue, One solution is off-course what @Bart suggested, in which we can create a another object which will act like a mapping object to messages and users which contains one to one relationship. The only downside is you in that case there will lots of records in the database for every time if any notification generates.--OR--Second way is to create a long text area field on the same object Notification and give it a name like ReadBy, where we can store unique identifier ids of user in comma seperated manner, and everytime when user see check this ReadBy field for read and unread state. 