ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 2 replies, has 2 voices, and was last updated by Mike Kudelya Mike Kudelya 10 months, 3 weeks ago.

  • Creator
    Topic
  • #23625
    dwittig
    dwittig
    Participant

    Heyho,

    I’m trying to create a new task when a Contact Address is Created or updated.
    So far I can create the Task, but now I want to add a Contact as Context to the Task.

    My code:
    definitions:
    add_Task_when_address_updates:
    label: 'Add Task When Address is Updated'
    enabled: true
    entity: OroCRM\Bundle\ContactBundle\Entity\ContactAddress
    order: 10
    actions_configuration:
    - '@tree':
    actions:
    - '@find_entity': #Find Task Priority Normal
    class: OroCRM\Bundle\TaskBundle\Entity\TaskPriority
    attribute: $.priority
    where:
    name: 'normal'
    - '@find_entity': #Find Task Status open
    class: Extend\Entity\EV_Task_Status
    attribute: $.task_step
    where:
    id: 'open'
    - '@format_string': #Build Subject String
    attribute: $.address_subject
    string: 'Verifizierung Stammdaten - %address_owner%'
    arguments:
    address_owner: $.data.owner
    - '@create_entity': #Create new Task
    class: OroCRM\Bundle\TaskBundle\Entity\Task
    attribute: $.task
    data:
    taskPriority: $.priority
    status: $.task_step
    subject: $.address_subject
    description: 'Es wurde die Adresse geändert. Bitte prüfen Sie die Nationalität.'
    - '@unset_value': [$.task]
    triggers:
    add_Task_when_address_updates:
    -
    event: create
    priority: 10
    queued: false
    -
    event: update
    priority: 10
    queued: false

    So does Anyone know how to add a Context when you create a task with process.yml?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #23651
    dwittig
    dwittig
    Participant

    I found this solution:

    - '@call_method':
    object: $.task # task object calls method
    method: addActivityTarget # addActivityTarget adds Entity to task object
    method_parameters:
    [$.entity] # 'entity' is added as Context to task

    #23666
    Mike Kudelya
    Mike Kudelya
    Oro Core

    Hi

    Try to use:

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.