new task with new opportunity

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chrisjames
    Junior Member
    • May 2024
    • 7

    new task with new opportunity

    Hi

    Please could anyone advise. I'm trying to create a task on every new opportunity created and for it to parent the task. this is what I've got from the documentation.

    ifThen(
    entity\isNew(), // if condition is true
    $id = record\create('Task','name','Initial Enquiry','parent','entity\getname()'),
    )

    Thanks
    Chris
  • lazovic
    Super Moderator
    • Jan 2022
    • 810

    #2
    Hi chrisjames,

    Please use the following formula script to create a task on every new opportunity created:
    Code:
    ​if (entity\isNew()) {
        record\create('Task',
                      'name', 'Initial Enquiry',
                      'parentType', 'Opportunity',
                      'parentId', id)
    }

    Comment

    • chrisjames
      Junior Member
      • May 2024
      • 7

      #3
      Hi Iazovic,
      Thank you very much. Works perfect.
      ?

      Comment

      Working...