Discussion Forums

How to add task in tasklist?

 
New Member
3 posts

I am using php to import the task in tasklist by API and my code is

<?php

  define(‘USER’, ‘sample@sample.com’);
  define(‘TOKEN’, ‘XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX’); 
 
  require ‘Solve360Service.php’;
 
  $solve360Service = new Solve360Service(USER, TOKEN);
 
  $title=“sample task”;
  $duedate=“2010-02-16”;
  $details=“sample desc”;
  $contactId_temp=“21154052”;
     
      $noteData = array(
        ‘title’ => $title,
        ‘details’ => $details,
        ‘assignedto’ => 1,
        ‘nodate’ => 0,
        ‘duedate’ => $duedate,
        ‘completed’ => 0,
        ‘sendnotification’ => 0,
        ‘remindtime’ => 30,
        ‘priority’ => 6,
        ‘billed’ => 0,
        ‘ignoreweekends’ => 0,
        ‘timespent’ => 10,
        ‘timespentmeasure’ => “”,
        ‘timeremains’ => 21,
        ‘timeremainsmeasure’ => “”,
        ‘invoiced’ => “”,
        ‘notifyoncomplete’ => “ramesh.bhartiya@netsutra.com”
      );
     
      $note = $solve360Service->addActivity($contactId_temp, ‘task’, $noteData);
      print_r($note);
      echo ” [ Done ]
“;
?>

But raise the following error :-

SimpleXMLElement Object ( [errors] => SimpleXMLElement Object ( [activitytypenotsupported] => Specified activity type is not supported ) [status] => failed )

Why not import the task by API.

Avatar
Lyncean
152 posts

Hey Ramesh,

That’s because you have to add a task to a tasklist. Adding a task to a contact is not supported. Refer to the “Supported Activity Hierarchies” here: http://norada.com/norada/crm/external_api_reference_contacts