Announcement

Collapse
No announcement yet.

Condition in the workflow

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

  • Condition in the workflow

    Hello
    How can I implement a check in the workflow for the number of Opportuity Activities associated with it.
    Example:
    If all Activities related to Opportunity have stage "close", then execute my code.
    Click image for larger version  Name:	image_0127911632 (1).png Views:	1 Size:	72.8 KB ID:	32726

  • #2
    Hi,

    Needs coding. You need to create a formula function. See https://www.espocrm.com/documentatio...on-in-formula/

    Comment


    • #3
      Originally posted by yurikuzn View Post
      Hi,

      Needs coding. You need to create a formula function. See https://www.espocrm.com/documentatio...on-in-formula/
      Thanks for the answer, but I think it will be easier for me to implement this using the "Service Action".
      Tell me please how to get Activities related to Opportunity?

      Comment


      • #4
        I tried to do this, but my code does not work
        PHP Code:
        $dostavki $this->getEntityManager()->getEntity('Dostavki'$entity->get('Id'));
                      
        $opportunity $this->getEntityManager()->getEntity($entity->get('parentType'), $entity->get('parentId'));
                      
        $parentType $entity->get('parentType');
                      
        $parentName $this->get('parentName');
                      
        $parentId $entity->get('parentId'); 
        I tried to find all the entity with a certain variable "Parent"
        PHP Code:
        $Dostavkilist $entityManager->getRepository('Dostavki')->where(array(
            
        'parentName' => $parentName'parentId' => $parentId  ))->find(); 
        Help me please

        Comment


        • #5
          Hello
          Use for searching parentType instead of parentName

          Comment


          • #6
            It works!
            Thank!
            Last edited by mr2d2; 11-28-2017, 10:23 AM.

            Comment

            Working...
            X