Announcement

Collapse
No announcement yet.

Workflow for case to auto switch to "in progress"

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

  • Workflow for case to auto switch to "in progress"

    I need the case status to auto switch to "in progress" when there are no unreplied emails that are not from our Address in a case.

    I tried to find the count of the emails with that criteria, in formula sandbox with:
    PHP Code:
    $noOfEmails record\count('Email''parentId='$caseId'fromAddress=' 'test@email.com');
    output\printLine($noOfEmails
    but I get "error 500"
    No primary filter 'fromAddress'

    any ideas?

  • #2
    Originally posted by Emmker View Post
    I need the case status to auto switch to "in progress" when there are no unreplied emails that are not from our Address in a case.

    I tried to find the count of the emails with that criteria, in formula sandbox with:
    PHP Code:
    $noOfEmails record\count('Email''parentId='$caseId'fromAddress=' 'test@email.com');
    output\printLine($noOfEmails
    but I get "error 500"
    No primary filter 'fromAddress'

    any ideas?
    you are missing a comma between fromAddress and the value hence why system thinks it is a primary filter. try this

    PHP Code:
    $noOfEmails record\count('Email''parentId='$caseId'fromAddress=''test@email.com');
    output\printLine($noOfEmails);​ 

    Comment


    • #3
      Originally posted by rabii View Post

      you are missing a comma between fromAddress and the value hence why system thinks it is a primary filter. try this

      PHP Code:
      $noOfEmails record\count('Email''parentId='$caseId'fromAddress=''test@email.com');
      output\printLine($noOfEmails);​ 
      Thank you. I wasn't missing a comma on the sandbox, It was a typo in the forum.
      Same thing.
      error 500

      Comment


      • yuri
        yuri commented
        Editing a comment
        According the error message "No primary filter 'fromAddress'", it was a missing comma issue.

    • #4
      The error in the log tells for itself:
      ERROR: (42S22) SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email.from_address' in 'where clause'; POST /Formula/action/run; line: 77, file: D:\xampp\htdocs\espo\application\Espo\ORM\Executor \DefaultSqlExecutor.php


      There's no fromAddress attribute in Email. You can use "fromAddressId=" instead. But you will need to obtain the email address ID first.

      Comment


      • #5
        I run
        PHP Code:
        output\printLine(fromAddressId
        from formula sandbox with target type: Email and Target: one email with the sender I want, and I get null

        There's no fromAddress attribute in Email. You can use "fromAddressId=" instead. But you will need to obtain the email address ID first.
        Never mind. I ran it with fromEmailAddressId and I got the id
        Last edited by Emmker; 02-19-2024, 10:33 AM.

        Comment

        Working...
        X