Skip to content

Commit 968b577

Browse files
committed
Support given to trigger off the workflows and to trigger selected auto
actions.
1 parent 0885cd4 commit 968b577

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/com/zoho/crm/library/api/handler/MassEntityAPIHandler.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static function getInstance($moduleInstance)
1717
{
1818
return new MassEntityAPIHandler($moduleInstance);
1919
}
20-
public function createRecords($records)
20+
public function createRecords($records,$trigger)
2121
{
2222
if(sizeof($records) > 100)
2323
{
@@ -41,6 +41,10 @@ public function createRecords($records)
4141
}
4242
}
4343
$requestBodyObj["data"]=$dataArray;
44+
if($trigger !== null && is_array($trigger))
45+
{
46+
$requestBodyObj["trigger"]=$trigger;
47+
}
4448
$this->requestBody = $requestBodyObj;
4549

4650
//Fire Request
@@ -125,7 +129,7 @@ public function upsertRecords($records)
125129
}
126130
}
127131

128-
public function updateRecords($records)
132+
public function updateRecords($records,$trigger)
129133
{
130134
if(sizeof($records) > 100)
131135
{
@@ -147,6 +151,10 @@ public function updateRecords($records)
147151
array_push($dataArray,$recordJSON);
148152
}
149153
$requestBodyObj["data"]=$dataArray;
154+
if($trigger !== null && is_array($trigger))
155+
{
156+
$requestBodyObj["trigger"]=$trigger;
157+
}
150158
$this->requestBody = $requestBodyObj;
151159

152160
//Fire Request

src/com/zoho/crm/library/crud/ZCRMModule.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -552,13 +552,13 @@ public function massUpdateRecords($entityIds,$fieldApiName,$value)
552552
{
553553
return MassEntityAPIHandler::getInstance($this)->massUpdateRecords($entityIds,$fieldApiName,$value);
554554
}
555-
public function updateRecords($records)
555+
public function updateRecords($records,$trigger=null)
556556
{
557-
return MassEntityAPIHandler::getInstance($this)->updateRecords($records);
557+
return MassEntityAPIHandler::getInstance($this)->updateRecords($records,$trigger);
558558
}
559-
public function createRecords($records)
559+
public function createRecords($records,$trigger=null)
560560
{
561-
return MassEntityAPIHandler::getInstance($this)->createRecords($records);
561+
return MassEntityAPIHandler::getInstance($this)->createRecords($records,$trigger);
562562
}
563563
public function upsertRecords($records)
564564
{

0 commit comments

Comments
 (0)