Notification when an Internal Note is in a Person's record

Hi All.

I was wondering how to display a notification or an alert message that there is an internal note found within a person's record.
I'm currently using 7.2e and will be going to 7.3 shortly.

I have no real clue where to start with notifications. I assume there is SQL code required to display a message.

Let me know.

Thanks,

Stephane L

Parents
  • 0

    Stephan

    You could use a number of approaches. It would be very tempting to use the client side API to do this as it can issue Ajax calls into the database and then display a message on the screen. The small trouble with that is that it requires there to be underlying views to set up on the Notes table that are exposed to SData. SData is our RESTful API used by the Client Side API. There are articles that discuss that. But unfortunately there is one Notes view created by default in the system and that is not exposed to SData. That means we would have create a view, expose to SData and then write the client side code to do the lookup.

    So instead we could take a simple approach like only displaying the 'Notes' tab if there are notes for that person. E.g.

    You could do that by adding the following into the SQL Clause of the 'Notes' tab in the Person Tab group.

    exists (select * from vnotes where Note_ForeignTableId = 13 and note_foreignid = pers_personid)

    Or you could you use the dummy field approach.

    See: community.sagecrm.com/.../how-do-i-put-calculated-or-derived-info-in-a-screen-s-top-content.aspx

    The below code is the script you could add to the Create Script of the dummy field to announce whether you have Notes or not

    var intRecordId = CRM.GetContextInfo("person","pers_personid");

    var myRecord = CRM.FindRecord("notes","Note_ForeignTableId = 13 and note_foreignid="+intRecordId);

    if (!myRecord.eof)

    {

    Caption = "You have notes";

    }

    else

    {

    Caption = "No notes";

    }

Reply
  • 0

    Stephan

    You could use a number of approaches. It would be very tempting to use the client side API to do this as it can issue Ajax calls into the database and then display a message on the screen. The small trouble with that is that it requires there to be underlying views to set up on the Notes table that are exposed to SData. SData is our RESTful API used by the Client Side API. There are articles that discuss that. But unfortunately there is one Notes view created by default in the system and that is not exposed to SData. That means we would have create a view, expose to SData and then write the client side code to do the lookup.

    So instead we could take a simple approach like only displaying the 'Notes' tab if there are notes for that person. E.g.

    You could do that by adding the following into the SQL Clause of the 'Notes' tab in the Person Tab group.

    exists (select * from vnotes where Note_ForeignTableId = 13 and note_foreignid = pers_personid)

    Or you could you use the dummy field approach.

    See: community.sagecrm.com/.../how-do-i-put-calculated-or-derived-info-in-a-screen-s-top-content.aspx

    The below code is the script you could add to the Create Script of the dummy field to announce whether you have Notes or not

    var intRecordId = CRM.GetContextInfo("person","pers_personid");

    var myRecord = CRM.FindRecord("notes","Note_ForeignTableId = 13 and note_foreignid="+intRecordId);

    if (!myRecord.eof)

    {

    Caption = "You have notes";

    }

    else

    {

    Caption = "No notes";

    }

Children
No Data