Announcement

Collapse
No announcement yet.

Stream|Post

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stream|Post

    I want to display a post with "Stream Post" in the "Leads" tab in the Comment column. How to do it? I need this tab to display the latest messages left by employees. Help me please...

  • #2
    You can write formula for Note which representing the stream rows from this link:
    Code:
    https://your-crm.com/#Admin/entityManager/formula&scope=Note
    Here is the formula for Case, replace it with Lead:

    Code:
    ifThen(
        parentType == 'Case' && type == 'Post',
    
        record\update('Case', parentId, 'lastComment', string\concatenate(createdBy.name, ': ', post));
    );
    CEO & Founder of Eblasoft.
    Professional EspoCRM development & extensions.

    Comment


    • Jakub Grufik
      Jakub Grufik commented
      Editing a comment
      hello eymen, this is really cool, is there any reason why the formula of note entity is not accessible manually without modifying the URL? I did not know that you can cheat the system like that.

    • eymen-elkum
      eymen-elkum commented
      Editing a comment
      The right answer is on Yuri side, but I think there are some limitations and potential issues may caused if this used incorrectly, such features will lead to bring more support needs and Espo team is already working full

    • Jakub Grufik
      Jakub Grufik commented
      Editing a comment
      got it, thank you

  • #3
    To make sure you get only the latest post when a new one is create use the function like below:
    PHP Code:
    ifThen(
        
    entity\isNew() && parentType == 'Lead' && type == 'Post',

        
    record\update('Lead'parentId'description'string\concatenate(createdBy.name': 'post));
    );
    ​​ 

    Comment


    • #4
      Originally posted by rabii View Post
      To make sure you get only the latest post when a new one is create use the function like below:
      PHP Code:
      ifThen(
      entity\isNew() && parentType == 'Lead' && type == 'Post',

      record\update('Lead'parentId'description'string\concatenate(createdBy.name': 'post));
      );
      ​​ 


      I went through the link
      PHP Code:
      #Admin/entityManager/formula&scope=Note 
      Added a function
      PHP Code:

      ifThen
      (
          
      parentType == 'Lead' && type == 'Post',

          
      record\update('Lead'parentId'lastComment'string\concatenate(createdBy.name': 'post)); )
      ;
      ifThen(
          
      entity\isNew() && parentType == 'Lead' && type == 'Post',

          
      record\update('Lead'parentId'description'string\concatenate(createdBy.name': 'post));
      );
      ​ 

      Nothing happened. in Layouts there is no option to add a Last Comment column​​
      Last edited by coca22052022; 05-17-2023, 11:57 AM.

      Comment


      • rabii
        rabii commented
        Editing a comment
        don't use the function twice just use of them no need for the ifThen twice just use one of them. also note that you should change (lastComment Or description) with the field you have on your lead in which you want to print the last post.

    • #5
      All windows worked!!!

      Comment


      • #6
        Originally posted by rabii View Post
        To make sure you get only the latest post when a new one is create use the function like below:
        PHP Code:
        ifThen(
        entity\isNew() && parentType == 'Lead' && type == 'Post',

        record\update('Lead'parentId'description'string\concatenate(createdBy.name': 'post));
        );
        ​​ 


        Everything works fine, I see the last comment
        How to remove the name of the person who wrote the comment?​

        Comment


        • #7
          Just remove createdBy.name like below:

          PHP Code:
          ifThen(
          entity\isNew() && parentType == 'Lead' && type == 'Post',

          record\update('Lead'parentId'description'post);
          );
          ​​  ​ 

          Comment


        • #8
          I decided to start working on an extension for a custom field containing the latest post

          Click image for larger version

Name:	image.png
Views:	451
Size:	38.3 KB
ID:	92588

          Comment


          • #9
            Originally posted by rabii View Post
            Just remove createdBy.name like below:

            PHP Code:
            ifThen(
            entity\isNew() && parentType == 'Lead' && type == 'Post',

            record\update('Lead'parentId'description'post);
            );
            ​​ ​ 
            how to add a pencil next to the status, so that when clicked, a list with statuses pops up, and you can select a status.?
            how to add a pencil next to the status, so that when clicked, a list with statuses pops up, and you can select a status.?
            how to add a pencil next to the status, so that when clicked, a list with statuses pops up, and you can select a status.?

            Comment


            • #10
              if you want such behaviour you will have to code it yourself, otherwise there is an extension developed by telecastg which give you such functionality. check it out https://payhip.com/b/ZGQMH

              Comment


              • espcrm
                espcrm commented
                Editing a comment
                Surprise you remember this one.

              • rabii
                rabii commented
                Editing a comment
                telecastg is a talented dev so i remember all his work. he has helped a lot here explaining how you can do things and how things work in espocrm. i do remember most of your posts as well.

              • telecastg
                telecastg commented
                Editing a comment
                Thanks for your kind words rabii the feeling is mutual.

            • #11
              I don't understand what happened, but now it doesn't work.

              I write the link https://office-crm.ru/#Admin/entityM...ula&scope=Note

              This link is throwing an error.
              Help solve the error​

              Comment


              • #12
                Starting with version 7.5, EspoCRM has a choice between formula scripts: Before-save script and API Before-Save Script.

                Therefore, now, in order to change the formula script for the Note entity, you need to follow the link of the following type: [your_instance_URL]/#Admin/entityManager/formula&scope=Note&type=beforeSaveCustomScript

                Comment


                • Decepticon
                  Decepticon commented
                  Editing a comment
                  Hello lazovic, can you guide me on how to all users within a specific rule be allowed to send messages only to themselves + admin, and not to other users within the same rule?? Your help would be greatly appreciated. Thank you in advance.
                  Last edited by Decepticon; 07-08-2023, 03:58 AM.

              • #13
                Originally posted by lazovic View Post
                Starting with version 7.5, EspoCRM has a choice between formula scripts: Before-save script and API Before-Save Script.

                Therefore, now, in order to change the formula script for the Note entity, you need to follow the link of the following type: [your_instance_URL]/#Admin/entityManager/formula&scope=Note&type=beforeSaveCustomScript

                ​This does not work! I created a field: text - 'lastcomment' I followed the link:
                [your_instance_URL]/#Admin/entityManager/formula&scope=Note&type=beforeSaveCustomScript

                WRITE a script
                ifThen(
                entity\isNew() && parentType == 'Lead' && type == 'Post',

                record\update('Lead', parentId, 'lastcomment​', post);
                );​​ ​​
                made a note on the tape. nothing appeared on the main page in the last comment column.
                HELP MEEEE

                how to make it work?​
                how to make it work?​


                Comment


                • rabii
                  rabii commented
                  Editing a comment
                  can you share a screenshot of the formula page
              Working...
              X