Quantity records in Report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ksv
    Member
    • Jul 2020
    • 59

    Quantity records in Report

    Dear all, Could you tell me how can i get the quantity of records in report? (please see BPMN below)
    I get a report from start event
    Then in Action I need to get quantity of records in report ( Execute Formula Script maybe???)

    Then if quantity >0 i send message to telegram else do nothing.
    Attached Files
  • Maximus
    Senior Member
    • Nov 2018
    • 2731

    #2
    Hi there,
    Do you need to send the quantity value with the Telegram message?
    If not, then you don't need this check at all, because BPM won't start once the report is empty.
    If you want to get this value, then I don't have an idea of how to achieve it with Formula.

    Comment

    • ksv
      Member
      • Jul 2020
      • 59

      #3
      I don't need to send this value to telegram.
      By the way is this the rigt way to define the quantity of records? ($Num=entity\sumRelated('Lead','IDReport'))

      Comment

      • Maximus
        Senior Member
        • Nov 2018
        • 2731

        #4
        Not exactly.
        1. You should know that the entity\sumRelated function sums the value of the field (e.g. sums the amount field values);
        2. To count the quantity of the related records you need to use this formula: entity\countRelated https://docs.espocrm.com/administrat...tycountrelated
        3. To utilize report as the filter option you need to create a Report Filter first, then use it in a formula as the filter. See example https://docs.espocrm.com/administration/formula/#filter.

        Comment

        • ksv
          Member
          • Jul 2020
          • 59

          #5
          I've faced with some issue. I have 212 records from report in timer. I send these records in action to telegram, but to telegram comes only 30-40 records. I see 212 records in procesess.
          What could be causing the problem?

          Another issue! I set */30 * * * * frequency in timer for cron.
          Messages must be forwarded to telegram every 30 min, but they are forwarded every 10 min.
          I see that's due to Run Scheduled Workflows because there is */10 * * * *. How to fix this?
          Attached Files
          Last edited by ksv; 11-20-2020, 06:45 AM.

          Comment

          • Maximus
            Senior Member
            • Nov 2018
            • 2731

            #6
            1. Probably your limitation might be linked to this https://core.telegram.org/bots/faq#m...-i-avoid-this?
            2. If you set the Timer to start every 30 min (*/30 * * * *) that after the job execution the system should set the next start time after 30 min. This job executes by the Run Scheduled Workflows Job.
            3. If Run Scheduled Workflows Job runs every 10 min, it doesn't mean that it will trigger this flowchart. When the job is executing it checks whether there is no Pending job that should be already executed. If the pending process is matched, then Run Scheduled Workflows Job executes such process.

            Comment

            Working...