Skip to content

Commit

Permalink
Support given to trigger off the workflows and to trigger selected auto
Browse files Browse the repository at this point in the history
actions.
  • Loading branch information
sumanthchilka committed Sep 6, 2018
1 parent 0885cd4 commit 968b577
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 10 additions & 2 deletions src/com/zoho/crm/library/api/handler/MassEntityAPIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static function getInstance($moduleInstance)
{
return new MassEntityAPIHandler($moduleInstance);
}
public function createRecords($records)
public function createRecords($records,$trigger)
{
if(sizeof($records) > 100)
{
Expand All @@ -41,6 +41,10 @@ public function createRecords($records)
}
}
$requestBodyObj["data"]=$dataArray;
if($trigger !== null && is_array($trigger))
{
$requestBodyObj["trigger"]=$trigger;
}
$this->requestBody = $requestBodyObj;

//Fire Request
Expand Down Expand Up @@ -125,7 +129,7 @@ public function upsertRecords($records)
}
}

public function updateRecords($records)
public function updateRecords($records,$trigger)
{
if(sizeof($records) > 100)
{
Expand All @@ -147,6 +151,10 @@ public function updateRecords($records)
array_push($dataArray,$recordJSON);
}
$requestBodyObj["data"]=$dataArray;
if($trigger !== null && is_array($trigger))
{
$requestBodyObj["trigger"]=$trigger;
}
$this->requestBody = $requestBodyObj;

//Fire Request
Expand Down
8 changes: 4 additions & 4 deletions src/com/zoho/crm/library/crud/ZCRMModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,13 +552,13 @@ public function massUpdateRecords($entityIds,$fieldApiName,$value)
{
return MassEntityAPIHandler::getInstance($this)->massUpdateRecords($entityIds,$fieldApiName,$value);
}
public function updateRecords($records)
public function updateRecords($records,$trigger=null)
{
return MassEntityAPIHandler::getInstance($this)->updateRecords($records);
return MassEntityAPIHandler::getInstance($this)->updateRecords($records,$trigger);
}
public function createRecords($records)
public function createRecords($records,$trigger=null)
{
return MassEntityAPIHandler::getInstance($this)->createRecords($records);
return MassEntityAPIHandler::getInstance($this)->createRecords($records,$trigger);
}
public function upsertRecords($records)
{
Expand Down

0 comments on commit 968b577

Please sign in to comment.