Welcome to Vtiger Community. To gain access for account, please contact [ community @ vtiger.com ]
Vt *: In import, vtiger.batchevent.save is triggered, but then in EventTrigger class it restricts events to only 3 classes. This does not allows to execute custom registered function for batch event.
As such all the batch events are restricted to be handled by only the mentioned classes.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
Activity
Sort or filter
Newest first
Oldest first
Show all activity
Show comments only
Show history only
Nilay KhatriTitle changed from *Vt : In import, vtiger.batchevent.save is triggered, but then in EventTrigger class iit restricts events to only 3 classes. This does not allows to execute custom registered function for batch event. to *Vt : In import, vtiger.batchevent.save is triggered, but then in EventTrigger class it restricts events to only 3 classes. This does not allows to execute custom registered function for batch event.
Title changed from *Vt : In import, vtiger.batchevent.save is triggered, but then in EventTrigger class iit restricts events to only 3 classes. This does not allows to execute custom registered function for batch event. to *Vt : In import, vtiger.batchevent.save is triggered, but then in EventTrigger class it restricts events to only 3 classes. This does not allows to execute custom registered function for batch event.
Basically if we want some kind of critical business process to be triggered on ANY kind of edit on a record, then this becomes a loophole.
A user can bypass those workflows if he/she edits the records in following ways:
Mass Edit
Update via Webservices
Import and override/merge
These operations never trigger a workflow. As such the possible way is to add an evven listener on batch update and execute those critical Business Process/workflow.
I understand that we can not trigger workflows on mass edits as that will slow down the system and will take a lot of time and can even create loops.
But some of the processes are critical to be executed on any record update and as such adding even listener to batch update is the only possibility.
Like for one of our customer, they want to add a Contact to a particular Campaign when a picklist "Last Call Status" value is changed to "Contacted".
Like in many of companies, telecalling is handled mostly out of the internal CRM. The telecall team shares an updated sheet with the status of call to respective contacts.
Then this sheet is imported back to CRM with override. Which updates the "Last Call Status" as contacted and adds them to a Campaign. That further triggers the marketing activities. (Another pain, we do not have events triggered whn record added to campaign or removed from campaign )
Now, without Mass Editing or Import being able to execute Event Handlers or Workflows, user has to manually open each contact and update the status. (Which if is more then 100 records per day, is a huge pain)
I can give numerous real world situations where it is critical that atleast certain workflows to be triggered on Mass edit or Import.
I am about to start work on porting our "Vlastic Search" marketplace module, for vtiger version 6, so it works with recent versions of Elastic Search and vtiger 7. This makes use of both the vtiger.batchevent.save, and vtiger.batchevent.delete event triggers.
@prasad Does the Vtiger On-demand Webhooks module triggers registered hooks upon import or mass edit? if yes, how is that achieved without using batchevents?
Also if yes, we shall move our client to Vtiger on-demand (also does Webhooks triggers upon delete?).
@nilay.automatesmb - If data-overload troubles operation execution it would no be enabled through batchevents. Our cloud infrastructure deals with such overload with some-smartness using supportive micro-services powering its backend. For information related to Cloud feature you can reach to our support team or refer the documentation.
schedule a cron task which keeps track of new modified or deleted records.
Have a table where you store the last scan time and then upon the execution of Scheduled task, look for records which have been modified since the last run time of task and process those records as required.
@nilay.automatesmb - Due to operation difficult the decision to restrict the event was made in the framework.
Adopters are free to experiment.
Your suggestion may be addressing to specific operational need of batch-event and not all. I would rather add why the intent it serves to avoid adopters getting into wrong direction.
@prasad "Your suggestion may be addressing to specific operational need of batch-event and not all. I would rather add why the intent it serves to avoid adopters getting into wrong direction."
completely agree.
They are suggestions, adopters must choose wisely.
I now have a pretty much working version of Vlastic Search for vtiger 7.1 and Elasticsearch 6.
One of the features we have in the version for vtiger 6 is listening for the "batch" save and delete event handlers for when multiple records have been added or deleted (via import for example) so we can rapidly update the elasticsearch index.
I ask again, what is vtiger's recommended way for developers to deal with data following an import of new records? We used to be able to use the vtiger.batchevent.save trigger to process these records.